summaryrefslogtreecommitdiff
path: root/shared/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'shared/runtime')
-rw-r--r--shared/runtime/pyexec.c6
-rw-r--r--shared/runtime/pyexec.h5
2 files changed, 1 insertions, 10 deletions
diff --git a/shared/runtime/pyexec.c b/shared/runtime/pyexec.c
index a305e6a5d..9dc4446ed 100644
--- a/shared/runtime/pyexec.c
+++ b/shared/runtime/pyexec.c
@@ -44,7 +44,6 @@
#include "genhdr/mpversion.h"
pyexec_mode_kind_t pyexec_mode_kind = PYEXEC_MODE_FRIENDLY_REPL;
-int pyexec_system_exit = 0;
#if MICROPY_REPL_INFO
static bool repl_display_debugging_info = 0;
@@ -74,9 +73,6 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
MICROPY_BOARD_BEFORE_PYTHON_EXEC(input_kind, exec_flags);
#endif
- // by default a SystemExit exception returns 0
- pyexec_system_exit = 0;
-
nlr_buf_t nlr;
nlr.ret_val = NULL;
if (nlr_push(&nlr) == 0) {
@@ -146,7 +142,7 @@ static int parse_compile_execute(const void *source, mp_parse_input_kind_t input
// check for SystemExit
if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(((mp_obj_base_t *)nlr.ret_val)->type), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) {
// at the moment, the value of SystemExit is unused
- ret = pyexec_system_exit;
+ ret = PYEXEC_FORCED_EXIT;
} else {
mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val));
ret = 0;
diff --git a/shared/runtime/pyexec.h b/shared/runtime/pyexec.h
index 64c5ef943..5779d3e09 100644
--- a/shared/runtime/pyexec.h
+++ b/shared/runtime/pyexec.h
@@ -35,11 +35,6 @@ typedef enum {
extern pyexec_mode_kind_t pyexec_mode_kind;
-// Set this to the value (eg PYEXEC_FORCED_EXIT) that will be propagated through
-// the pyexec functions if a SystemExit exception is raised by the running code.
-// It will reset to 0 at the start of each execution (eg each REPL entry).
-extern int pyexec_system_exit;
-
#define PYEXEC_FORCED_EXIT (0x100)
int pyexec_raw_repl(void);