From ad3724e0bc87305f9280f65226066a199042d736 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 17 Oct 2016 13:14:59 +1100 Subject: 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. --- lib/utils/pyexec.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/utils/pyexec.h') 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) -- cgit v1.2.3