py/objgenerator: When throwing an object, don't make an exc instance.
Arguments to throw() for generators don't need to be exceptions.
This commit is contained in:
parent
aeb2655073
commit
681994638b
|
@ -193,7 +193,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(gen_instance_send_obj, gen_instance_send);
|
|||
STATIC mp_obj_t gen_instance_close(mp_obj_t self_in);
|
||||
STATIC mp_obj_t gen_instance_throw(size_t n_args, const mp_obj_t *args) {
|
||||
mp_obj_t exc = (n_args == 2) ? args[1] : args[2];
|
||||
exc = mp_make_raise_obj(exc);
|
||||
|
||||
mp_obj_t ret = gen_resume_and_raise(args[0], mp_const_none, exc);
|
||||
if (ret == MP_OBJ_STOP_ITERATION) {
|
||||
|
|
Loading…
Reference in New Issue