mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
py/runtime: Fix self arg passed to classmethod when accessed via super.
Thanks to @AJMansfield for the original test case. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -1153,6 +1153,10 @@ void mp_convert_member_lookup(mp_obj_t self, const mp_obj_type_t *type, mp_obj_t
|
||||
// base type (which is what is passed in the `type` argument to this function).
|
||||
if (self != MP_OBJ_NULL) {
|
||||
type = mp_obj_get_type(self);
|
||||
if (type == &mp_type_type) {
|
||||
// `self` is already a type, so use `self` directly.
|
||||
type = MP_OBJ_TO_PTR(self);
|
||||
}
|
||||
}
|
||||
dest[0] = ((mp_obj_static_class_method_t *)MP_OBJ_TO_PTR(member))->fun;
|
||||
dest[1] = MP_OBJ_FROM_PTR(type);
|
||||
|
||||
Reference in New Issue
Block a user