summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-10-07 02:13:58 +1100
committerDamien George <damien@micropython.org>2022-10-11 18:10:26 +1100
commit0e8dfaf5384c672fc61bc10926688809db2b2ab2 (patch)
treea13818c29b0d0be4f7a5a7ba749892dbeffa95c7 /py/mpconfig.h
parentc44b3927b8f464e1e01c07b2431e7db251e6d8c0 (diff)
py/modsys: Add support for sys.executable.
Only intended to be used on Unix and other "OS" ports. Matches CPython. This should give the absolute path to the executing binary. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 698d264d2..99fa87e5c 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1372,6 +1372,13 @@ typedef double mp_float_t;
#define MICROPY_PY_SYS_EXC_INFO (0)
#endif
+// Whether to provide "sys.executable", which is the absolute path to the
+// micropython binary
+// Intended for use on the "OS" ports (e.g. Unix)
+#ifndef MICROPY_PY_SYS_EXECUTABLE
+#define MICROPY_PY_SYS_EXECUTABLE (0)
+#endif
+
// Whether to provide "sys.exit" function
#ifndef MICROPY_PY_SYS_EXIT
#define MICROPY_PY_SYS_EXIT (1)