Skip to content

Commit d1e17fd

Browse files
committed
objtype: Restore our customized behavior of instance_subscr
For pixelbuf's [] to be able to call _transmit on the Python subclass, we need to do the subscripting operation specially.
1 parent 5258969 commit d1e17fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py/objtype.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ STATIC mp_obj_t instance_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value
854854
}
855855
mp_obj_class_lookup(&lookup, self->base.type);
856856
if (member[0] == MP_OBJ_SENTINEL) {
857-
mp_obj_t ret = mp_obj_subscr(self->subobj[0], index, value);
857+
mp_obj_type_t *subobj_type = mp_obj_get_type(self->subobj[0]);
858+
mp_obj_t ret = subobj_type->subscr(self_in, index, value);
858859
// May have called port specific C code. Make sure it didn't mess up the heap.
859860
assert_heap_ok();
860861
return ret;

0 commit comments

Comments
 (0)