diff options
author | Damien George <damien@micropython.org> | 2021-12-17 23:35:32 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-12-18 00:08:07 +1100 |
commit | de43b500bdff465539d89c5004d9e8cb3849eab1 (patch) | |
tree | 00e10489fa3b8dd9d785b60999a4239ee9aa0016 /py/mpconfig.h | |
parent | 86394f70fcd7b9fa66ec952711e5d64557d81a1e (diff) |
py/runtime: Allow initialising sys.path/argv with defaults.
If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is enabled (which it is by default)
then sys.path and sys.argv will be initialised and populated with default
values. This keeps all bare-metal ports aligned.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 86e3e0f34..f0d11961d 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1306,6 +1306,11 @@ typedef double mp_float_t; #define MICROPY_PY_SYS (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES) #endif +// Whether to initialise "sys.path" and "sys.argv" to their defaults in mp_init() +#ifndef MICROPY_PY_SYS_PATH_ARGV_DEFAULTS +#define MICROPY_PY_SYS_PATH_ARGV_DEFAULTS (1) +#endif + // Whether to provide "sys.maxsize" constant #ifndef MICROPY_PY_SYS_MAXSIZE #define MICROPY_PY_SYS_MAXSIZE (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES) |