diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2020-01-24 18:22:28 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2020-01-24 18:22:28 -0800 |
| commit | 81c3bc411fadd41890d4e432a204a12d0750955b (patch) | |
| tree | b67113dc9e93b0caf5c53dcaf534a4318b5c178f /py | |
| parent | b3c09e1bc06331a83c063ab66536c9aa729de210 (diff) | |
Don't assume native methods want the native object as self.
Diffstat (limited to 'py')
| -rw-r--r-- | py/objtype.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/py/objtype.c b/py/objtype.c index a5e733208..ad68b85d2 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -187,14 +187,7 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_ return; } else { mp_obj_instance_t *obj = lookup->obj; - mp_obj_t obj_obj; - if (obj != NULL && mp_obj_is_native_type(type) && type != &mp_type_object /* object is not a real type */) { - // If we're dealing with native base class, then it applies to native sub-object - obj_obj = obj->subobj[0]; - } else { - obj_obj = MP_OBJ_FROM_PTR(obj); - } - mp_convert_member_lookup(obj_obj, type, elem->value, lookup->dest); + mp_convert_member_lookup(MP_OBJ_FROM_PTR(obj), type, elem->value, lookup->dest); } #if DEBUG_PRINT printf("mp_obj_class_lookup: Returning: "); |
