summaryrefslogtreecommitdiffstatshomepage
path: root/lib/utils/pyexec.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-12 18:00:32 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-12 18:00:32 +0300
commit4021b1e1b86a86af9e43c393c447110d36ebb36d (patch)
tree7e9778747b293828a19b93b897a2a466c0857f17 /lib/utils/pyexec.c
parentaf8d791bd09e2d735ec59424ec05f495348d99e7 (diff)
downloadmicropython-4021b1e1b86a86af9e43c393c447110d36ebb36d.tar.gz
micropython-4021b1e1b86a86af9e43c393c447110d36ebb36d.zip
lib/utils/pyexec: Don't treat SystemExit as "forced exit".
"Forced exit" is treated as soft-reboot (Ctrl+D). But expected effect of calling sys.exit() is termination of the current script, not any further and more serious actions like mentioned soft reboot.
Diffstat (limited to 'lib/utils/pyexec.c')
-rw-r--r--lib/utils/pyexec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c
index 2bc7a00cc0..aac211894c 100644
--- a/lib/utils/pyexec.c
+++ b/lib/utils/pyexec.c
@@ -99,7 +99,7 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
// check for SystemExit
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_FORCED_EXIT;
+ ret = 0;
} else {
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
ret = 0;