Skip to content

Commit 724b825

Browse files
committed
zephyr/main: Initialize sys.path and sys.argv.
1 parent 87e426c commit 724b825

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

zephyr/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ int real_main(void) {
7272
gc_init(heap, heap + sizeof(heap));
7373
#endif
7474
mp_init();
75+
mp_obj_list_init(mp_sys_path, 0);
76+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script)
77+
mp_obj_list_init(mp_sys_argv, 0);
7578
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
7679

7780
#if MICROPY_MODULE_FROZEN

0 commit comments

Comments
 (0)