summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 2326dfb3c..f5d219728 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -136,13 +136,17 @@ void mp_init(void) {
#endif
#if MICROPY_PY_SYS_PATH_ARGV_DEFAULTS
- mp_obj_list_init(MP_OBJ_TO_PTR(mp_sys_path), 0);
+ #if MICROPY_PY_SYS_PATH
+ mp_sys_path = mp_obj_new_list(0, NULL);
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script)
#if MICROPY_MODULE_FROZEN
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__dot_frozen));
#endif
+ #endif
+ #if MICROPY_PY_SYS_ARGV
mp_obj_list_init(MP_OBJ_TO_PTR(mp_sys_argv), 0);
#endif
+ #endif // MICROPY_PY_SYS_PATH_ARGV_DEFAULTS
#if MICROPY_PY_SYS_ATEXIT
MP_STATE_VM(sys_exitfunc) = mp_const_none;