summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorScott Shawcroft <scott@chickadee.tech>2016-10-28 20:19:30 -0700
committerScott Shawcroft <scott@chickadee.tech>2016-10-28 20:19:30 -0700
commit7a24abb27c6cf9e738375ac6a8b1d58e9bf41084 (patch)
tree5964379cdabb62fc112e1801c2524a9daaf63621 /lib/utils
parent5b3a143ffe126b8cd999a6298ab3de9ec5532242 (diff)
lib/utils/pyexec: Return FORCED_EXIT from pyexec_file when its stopped by CTRL - C.
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/pyexec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c
index ce68e40b3..5be7e0291 100644
--- a/lib/utils/pyexec.c
+++ b/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;