lib/utils/pyexec: Return FORCED_EXIT from pyexec_file when its stopped by CTRL - C.

crypto-aes
Scott Shawcroft 6 years ago
parent 5b3a143ffe
commit 7a24abb27c
  1. 2
      lib/utils/pyexec.c

@ -104,6 +104,8 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_SystemExit)) {
// at the moment, the value of SystemExit is unused
ret = pyexec_system_exit;
} else if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_KeyboardInterrupt)) {
ret = PYEXEC_FORCED_EXIT;
} else {
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
ret = 0;

Loading…
Cancel
Save