diff --git a/py/proto.c b/py/proto.c index 9f110b9f9a..14fbaeee8d 100644 --- a/py/proto.c +++ b/py/proto.c @@ -31,7 +31,7 @@ #ifndef MICROPY_UNSAFE_PROTO const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) { const mp_obj_type_t *type = mp_obj_get_type(obj); - const void *protocol = mp_type_get_protocol_slot(type); + const void *protocol = MP_OBJ_TYPE_GET_SLOT_OR_NULL(type, protocol); if (!protocol) { return NULL; } diff --git a/py/proto.h b/py/proto.h index a7b9b523f2..19e75a67fc 100644 --- a/py/proto.h +++ b/py/proto.h @@ -31,7 +31,7 @@ #define MP_PROTOCOL_HEAD /* NOTHING */ #define MP_PROTO_IMPLEMENT(name) /* NOTHING */ static inline void *mp_proto_get(uint16_t name, mp_const_obj_type_t obj) { - return mp_type_get_protocol_slot(mp_obj_get_type(obj)); + return MP_OBJ_TYPE_GET_SLOT_OR_NULL(mp_obj_get_type(obj), protocol); } #else #define MP_PROTOCOL_HEAD \