Skip to content

Commit 81c3bc4

Browse files
committed
Don't assume native methods want the native object as self.
1 parent b3c09e1 commit 81c3bc4

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

py/objtype.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,7 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_
187187
return;
188188
} else {
189189
mp_obj_instance_t *obj = lookup->obj;
190-
mp_obj_t obj_obj;
191-
if (obj != NULL && mp_obj_is_native_type(type) && type != &mp_type_object /* object is not a real type */) {
192-
// If we're dealing with native base class, then it applies to native sub-object
193-
obj_obj = obj->subobj[0];
194-
} else {
195-
obj_obj = MP_OBJ_FROM_PTR(obj);
196-
}
197-
mp_convert_member_lookup(obj_obj, type, elem->value, lookup->dest);
190+
mp_convert_member_lookup(MP_OBJ_FROM_PTR(obj), type, elem->value, lookup->dest);
198191
}
199192
#if DEBUG_PRINT
200193
printf("mp_obj_class_lookup: Returning: ");

0 commit comments

Comments
 (0)