summaryrefslogtreecommitdiff
path: root/ports/unix/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/main.c')
-rw-r--r--ports/unix/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ports/unix/main.c b/ports/unix/main.c
index 3f415285c..7a3305a5d 100644
--- a/ports/unix/main.c
+++ b/ports/unix/main.c
@@ -145,21 +145,17 @@ STATIC int execute_from_lexer(int source_kind, const void *source, mp_parse_inpu
if (!compile_only) {
// execute it
mp_call_function_0(module_fun);
- // check for pending exception
- if (MP_STATE_VM(mp_pending_exception) != MP_OBJ_NULL) {
- mp_obj_t obj = MP_STATE_VM(mp_pending_exception);
- MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL;
- nlr_raise(obj);
- }
}
mp_hal_set_interrupt_char(-1);
+ mp_handle_pending(true);
nlr_pop();
return 0;
} else {
// uncaught exception
mp_hal_set_interrupt_char(-1);
+ mp_handle_pending(false);
return handle_uncaught_exception(nlr.ret_val);
}
}