Commit aa9dbb1b authored by Paul Sokolovsky's avatar Paul Sokolovsky Committed by Damien George
Browse files

objgenerator: If generator yielded STOP_ITERATION value, it's stopped.

MP_OBJ_STOP_ITERATION is equivalent of raising StopIteration, except
mp_vm_return_kind_t for it is "yield".
parent 5df81de7
......@@ -134,6 +134,9 @@ mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_
case MP_VM_RETURN_YIELD:
*ret_val = *self->code_state.sp;
if (*ret_val == MP_OBJ_STOP_ITERATION) {
self->code_state.ip = 0;
}
break;
case MP_VM_RETURN_EXCEPTION:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment