From 239f92029910cddb08a2669f3ebcd987f0a2d0a8 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 17 Jan 2017 00:16:56 +1100 Subject: [PATCH] py/objgenerator: Don't raise RuntimeError if GeneratorExit ignored. In this case it's allowed to be ignored. --- py/objgenerator.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/py/objgenerator.c b/py/objgenerator.c index 9468a21892..0be9b8d59c 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -156,9 +156,6 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o } case MP_VM_RETURN_YIELD: - 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))) { - mp_raise_msg(&mp_type_RuntimeError, "generator ignored GeneratorExit"); - } return ret; case MP_VM_RETURN_EXCEPTION: