py/mpstate.h: Only include sys.path/argv objects in state when enabled.
The mp_sys_path_obj and mp_sys_argv_obj objects are only used by the runtime and accessible from Python if MICROPY_PY_SYS is enabled. So exclude them from the runtime state if this option is disabled. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
de43b500bd
commit
fe9ffff9c0
@ -1308,7 +1308,7 @@ typedef double mp_float_t;
|
|||||||
|
|
||||||
// Whether to initialise "sys.path" and "sys.argv" to their defaults in mp_init()
|
// Whether to initialise "sys.path" and "sys.argv" to their defaults in mp_init()
|
||||||
#ifndef MICROPY_PY_SYS_PATH_ARGV_DEFAULTS
|
#ifndef MICROPY_PY_SYS_PATH_ARGV_DEFAULTS
|
||||||
#define MICROPY_PY_SYS_PATH_ARGV_DEFAULTS (1)
|
#define MICROPY_PY_SYS_PATH_ARGV_DEFAULTS (MICROPY_PY_SYS)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Whether to provide "sys.maxsize" constant
|
// Whether to provide "sys.maxsize" constant
|
||||||
|
@ -153,10 +153,12 @@ typedef struct _mp_state_vm_t {
|
|||||||
// dictionary for the __main__ module
|
// dictionary for the __main__ module
|
||||||
mp_obj_dict_t dict_main;
|
mp_obj_dict_t dict_main;
|
||||||
|
|
||||||
|
#if MICROPY_PY_SYS
|
||||||
// If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is not enabled then these two lists
|
// If MICROPY_PY_SYS_PATH_ARGV_DEFAULTS is not enabled then these two lists
|
||||||
// must be initialised after the call to mp_init.
|
// must be initialised after the call to mp_init.
|
||||||
mp_obj_list_t mp_sys_path_obj;
|
mp_obj_list_t mp_sys_path_obj;
|
||||||
mp_obj_list_t mp_sys_argv_obj;
|
mp_obj_list_t mp_sys_argv_obj;
|
||||||
|
#endif
|
||||||
|
|
||||||
// dictionary for overridden builtins
|
// dictionary for overridden builtins
|
||||||
#if MICROPY_CAN_OVERRIDE_BUILTINS
|
#if MICROPY_CAN_OVERRIDE_BUILTINS
|
||||||
|
Loading…
Reference in New Issue
Block a user