File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_
133133 // not type where we found a class method.
134134 const mp_obj_type_t * org_type = (const mp_obj_type_t * )lookup -> obj ;
135135 instance_convert_return_attr (NULL , org_type , elem -> value , lookup -> dest );
136- } else if (lookup -> obj != MP_OBJ_NULL && !lookup -> is_type && is_native_type (type )) {
136+ } else if (lookup -> obj != MP_OBJ_NULL && !lookup -> is_type && is_native_type (type ) && type != & mp_type_object /* object is not a real type */ ) {
137137 instance_convert_return_attr (lookup -> obj -> subobj [0 ], type , elem -> value , lookup -> dest );
138138 } else {
139139 instance_convert_return_attr (lookup -> obj , type , elem -> value , lookup -> dest );
@@ -149,7 +149,7 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_
149149
150150 // Try this for completeness, but all native methods should be statically defined
151151 // in locals_dict, and would be handled by above.
152- if (lookup -> obj != MP_OBJ_NULL && !lookup -> is_type && is_native_type (type )) {
152+ if (lookup -> obj != MP_OBJ_NULL && !lookup -> is_type && is_native_type (type ) && type != & mp_type_object /* object is not a real type */ ) {
153153 mp_load_method_maybe (lookup -> obj -> subobj [0 ], lookup -> attr , lookup -> dest );
154154 if (lookup -> dest [0 ] != MP_OBJ_NULL ) {
155155 return ;
You can’t perform that action at this time.
0 commit comments