Skip to content

Commit

Permalink
pyexec: Handle a ctrl-c that comes in "very late"
Browse files Browse the repository at this point in the history
In relatively unusual circumstances, such as entering `l = 17 ** 17777`
at the REPL, you could hit ctrl-c, but not get KeyboardInterrupt.
This can lead to a condition where the display would stop updating (micropython#2689).
  • Loading branch information
jepler committed Aug 25, 2020
1 parent 1033e89 commit e9bc8e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/utils/pyexec.c
Expand Up @@ -113,6 +113,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
start = mp_hal_ticks_ms();
mp_call_function_0(module_fun);
mp_hal_set_interrupt_char(-1); // disable interrupt
// Handle any ctrl-c interrupt that arrived just in time
mp_handle_pending();
nlr_pop();
ret = 0;
if (exec_flags & EXEC_FLAG_PRINT_EOF) {
Expand Down

0 comments on commit e9bc8e8

Please sign in to comment.