summaryrefslogtreecommitdiffstatshomepage
path: root/py/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/stream.h')
-rw-r--r--py/stream.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/stream.h b/py/stream.h
index 45f36ef5a6..4bc329b3e7 100644
--- a/py/stream.h
+++ b/py/stream.h
@@ -95,7 +95,7 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj);
// Object is assumed to have a non-NULL stream protocol with valid r/w/ioctl methods
static inline const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) {
- return (const mp_stream_p_t *)((const mp_obj_base_t *)MP_OBJ_TO_PTR(self))->type->protocol;
+ return (const mp_stream_p_t *)MP_OBJ_TYPE_GET_SLOT(((const mp_obj_base_t *)MP_OBJ_TO_PTR(self))->type, protocol);
}
const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags);