1 parent 9a54a22 commit ee5ecc9Copy full SHA for ee5ecc9
1 file changed
py/objgenerator.c
@@ -162,6 +162,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(gen_instance_send_obj, gen_instance_send);
162
STATIC mp_obj_t gen_instance_close(mp_obj_t self_in);
163
STATIC mp_obj_t gen_instance_throw(uint n_args, const mp_obj_t *args) {
164
mp_obj_t exc = (n_args == 2) ? args[1] : args[2];
165
+ exc = rt_make_raise_obj(exc);
166
if (mp_obj_is_subclass_fast(mp_obj_get_type(exc), &mp_type_GeneratorExit)) {
167
// Throwing GeneratorExit is equivalent of calling close aka
168
// GeneratorExit should be handled specially
0 commit comments