unix/main: Replace inline exception check code with mp_handle_pending().
@@ -160,11 +160,7 @@ STATIC int execute_from_lexer(int source_kind, const void *source, mp_parse_inpu
// 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_handle_pending();
}
mp_hal_set_interrupt_char(-1);
