Skip to content
Snippets Groups Projects
Commit 68199463 authored by Damien George's avatar Damien George
Browse files

py/objgenerator: When throwing an object, don't make an exc instance.

Arguments to throw() for generators don't need to be exceptions.
parent aeb26550
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment