Skip to content

Commit 4021b1e

Browse files
committed
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.
1 parent af8d791 commit 4021b1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/utils/pyexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
9999
// check for SystemExit
100100
if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), &mp_type_SystemExit)) {
101101
// at the moment, the value of SystemExit is unused
102-
ret = PYEXEC_FORCED_EXIT;
102+
ret = 0;
103103
} else {
104104
mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
105105
ret = 0;

0 commit comments

Comments
 (0)