summaryrefslogtreecommitdiff
path: root/py/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/py/vm.c b/py/vm.c
index 6e5015fc4..7c702f386 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -1266,17 +1266,10 @@ yield:
DISPATCH();
} else {
assert(ret_kind == MP_VM_RETURN_EXCEPTION);
+ assert(!EXC_MATCH(ret_value, MP_OBJ_FROM_PTR(&mp_type_StopIteration)));
// Pop exhausted gen
sp--;
- if (EXC_MATCH(ret_value, MP_OBJ_FROM_PTR(&mp_type_StopIteration))) {
- PUSH(mp_obj_exception_get_value(ret_value));
- // If we injected GeneratorExit downstream, then even
- // if it was swallowed, we re-raise GeneratorExit
- GENERATOR_EXIT_IF_NEEDED(t_exc);
- DISPATCH();
- } else {
- RAISE(ret_value);
- }
+ RAISE(ret_value);
}
}