diff options
author | Damien George <damien.p.george@gmail.com> | 2017-04-10 17:17:22 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-04-11 13:31:49 +1000 |
commit | 6c564aa408faf5d2769785b7ffc438a489310c3b (patch) | |
tree | f58cfa8723b2c71b624c4b9ed4580443d1d45458 /windows/windows_mphal.c | |
parent | 9156c8b460a4b013312466744b47bc4bb5506269 (diff) | |
download | micropython-6c564aa408faf5d2769785b7ffc438a489310c3b.tar.gz micropython-6c564aa408faf5d2769785b7ffc438a489310c3b.zip |
unix, windows: Use core-provided KeyboardInterrupt exception object.
Diffstat (limited to 'windows/windows_mphal.c')
-rw-r--r-- | windows/windows_mphal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c index 3ad6939059..1dd3105d86 100644 --- a/windows/windows_mphal.c +++ b/windows/windows_mphal.c @@ -79,12 +79,12 @@ void mp_hal_stdio_mode_orig(void) { // the thread created for handling it might not be running yet so we'd miss the notification. BOOL WINAPI console_sighandler(DWORD evt) { if (evt == CTRL_C_EVENT) { - 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)); return TRUE; } return FALSE; |