diff options
| author | Jeff Epler <jepler@unpythonic.net> | 2020-08-25 11:45:00 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@unpythonic.net> | 2020-08-25 11:45:00 -0500 |
| commit | e9bc8e892b5ccc88782d8aaf08868b0094eae414 (patch) | |
| tree | f65e22cd9c29b5620efbf2bec2596763969d7b61 | |
| parent | 1033e89561d6535f32aa4cfd3541ffd9683a1123 (diff) | |
pyexec: Handle a ctrl-c that comes in "very late"
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 (#2689).
| -rwxr-xr-x | lib/utils/pyexec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 8e99bc209..378fb6267 100755 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -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) { |
