summaryrefslogtreecommitdiffstatshomepage
path: root/lib/utils/pyexec.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-17 13:14:59 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-17 13:14:59 +1100
commitad3724e0bc87305f9280f65226066a199042d736 (patch)
tree16de7f66f999c0fda8dc093be4b9c9f989f35488 /lib/utils/pyexec.h
parent7d0d7215d2575a2d36d34c9a13b58cade0610a28 (diff)
downloadmicropython-ad3724e0bc87305f9280f65226066a199042d736.tar.gz
micropython-ad3724e0bc87305f9280f65226066a199042d736.zip
lib/utils/pyexec: Allow behaviour of SystemExit to be configurable.
Setting the pyexec_system_exit variable to PYEXEC_FORCED_EXT allows SystemExit exceptions to terminate the pyexec functions.
Diffstat (limited to 'lib/utils/pyexec.h')
-rw-r--r--lib/utils/pyexec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h
index e0f62440e0..ae69a195e7 100644
--- a/lib/utils/pyexec.h
+++ b/lib/utils/pyexec.h
@@ -33,6 +33,11 @@ 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)
#define PYEXEC_SWITCH_MODE (0x200)