Skip to content

Commit 239f920

Browse files
committed
py/objgenerator: Don't raise RuntimeError if GeneratorExit ignored.
In this case it's allowed to be ignored.
1 parent 6819946 commit 239f920

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

py/objgenerator.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o
156156
}
157157

158158
case MP_VM_RETURN_YIELD:
159-
if (throw_value != MP_OBJ_NULL && mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(mp_obj_get_type(throw_value)), MP_OBJ_FROM_PTR(&mp_type_GeneratorExit))) {
160-
mp_raise_msg(&mp_type_RuntimeError, "generator ignored GeneratorExit");
161-
}
162159
return ret;
163160

164161
case MP_VM_RETURN_EXCEPTION:

0 commit comments

Comments
 (0)