From 556ec9d30044caec2a53ccb83860ea641ba8fe87 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 22 Sep 2023 13:51:57 -0500 Subject: [PATCH] fixes for mp_type_get_protocol_slot --- py/proto.c | 2 +- py/proto.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 \