summaryrefslogtreecommitdiff
path: root/py/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/py/vm.c b/py/vm.c
index 404c79912..7451d53b9 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -1159,8 +1159,7 @@ yield:
ip--;
PUSH(ret_value);
goto yield;
- }
- if (ret_kind == MP_VM_RETURN_NORMAL) {
+ } else if (ret_kind == MP_VM_RETURN_NORMAL) {
// Pop exhausted gen
sp--;
// TODO: When ret_value can be MP_OBJ_NULL here??
@@ -1176,8 +1175,8 @@ yield:
// if it was swallowed, we re-raise GeneratorExit
GENERATOR_EXIT_IF_NEEDED(t_exc);
DISPATCH();
- }
- if (ret_kind == MP_VM_RETURN_EXCEPTION) {
+ } else {
+ assert(ret_kind == MP_VM_RETURN_EXCEPTION);
// Pop exhausted gen
sp--;
if (EXC_MATCH(ret_value, MP_OBJ_FROM_PTR(&mp_type_StopIteration))) {