summaryrefslogtreecommitdiff
path: root/unix/unix_mphal.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-04-10 17:17:22 +1000
committerDamien George <damien.p.george@gmail.com>2017-04-11 13:31:49 +1000
commit6c564aa408faf5d2769785b7ffc438a489310c3b (patch)
treef58cfa8723b2c71b624c4b9ed4580443d1d45458 /unix/unix_mphal.c
parent9156c8b460a4b013312466744b47bc4bb5506269 (diff)
unix, windows: Use core-provided KeyboardInterrupt exception object.
Diffstat (limited to 'unix/unix_mphal.c')
-rw-r--r--unix/unix_mphal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/unix/unix_mphal.c b/unix/unix_mphal.c
index 6c6666236..800484498 100644
--- a/unix/unix_mphal.c
+++ b/unix/unix_mphal.c
@@ -40,20 +40,20 @@
STATIC void sighandler(int signum) {
if (signum == SIGINT) {
#if MICROPY_ASYNC_KBD_INTR
- mp_obj_exception_clear_traceback(MP_STATE_VM(keyboard_interrupt_obj));
+ mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
sigset_t mask;
sigemptyset(&mask);
// On entry to handler, its signal is blocked, and unblocked on
// normal exit. As we instead perform longjmp, unblock it manually.
sigprocmask(SIG_SETMASK, &mask, NULL);
- nlr_raise(MP_STATE_VM(keyboard_interrupt_obj));
+ nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
#else
- if (MP_STATE_VM(mp_pending_exception) == MP_STATE_VM(keyboard_interrupt_obj)) {
+ if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) {
// this is the second time we are called, so die straight away
exit(1);
}
- mp_obj_exception_clear_traceback(MP_STATE_VM(keyboard_interrupt_obj));
- MP_STATE_VM(mp_pending_exception) = MP_STATE_VM(keyboard_interrupt_obj);
+ mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
+ MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
#endif
}
}