diff options
Diffstat (limited to 'py/dynruntime.h')
-rw-r--r-- | py/dynruntime.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/dynruntime.h b/py/dynruntime.h index fb748eb93f..be573bde2a 100644 --- a/py/dynruntime.h +++ b/py/dynruntime.h @@ -150,7 +150,7 @@ static inline mp_obj_t mp_obj_cast_to_native_base_dyn(mp_obj_t self_in, mp_const if (MP_OBJ_FROM_PTR(self_type) == native_type) { return self_in; - } else if (self_type->parent != native_type) { + } else if (MP_OBJ_TYPE_GET_SLOT_OR_NULL(self_type, parent) != native_type) { // The self_in object is not a direct descendant of native_type, so fail the cast. // This is a very simple version of mp_obj_is_subclass_fast that could be improved. return MP_OBJ_NULL; |