Skip to content

Commit 1eac05d

Browse files
committed
objgenerator: Another obscure case of propagating MP_OBJ_NULL optimization.
1 parent 1aa2c10 commit 1eac05d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/objgenerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o
127127
switch (mp_obj_gen_resume(self_in, send_value, throw_value, &ret)) {
128128
case MP_VM_RETURN_NORMAL:
129129
// Optimize return w/o value in case generator is used in for loop
130-
if (ret == mp_const_none) {
130+
if (ret == mp_const_none || ret == MP_OBJ_NULL) {
131131
return MP_OBJ_NULL;
132132
} else {
133133
nlr_jump(mp_obj_new_exception_args(&mp_type_StopIteration, 1, &ret));

0 commit comments

Comments
 (0)