Skip to content

Commit fb5017f

Browse files
committed
esp8266/main: Set sys.path to ["", "/", "/lib"].
1 parent 496a601 commit fb5017f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

esp8266/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ STATIC void mp_reset(void) {
4747
gc_init(heap, heap + sizeof(heap));
4848
mp_init();
4949
mp_obj_list_init(mp_sys_path, 0);
50+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script)
51+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_));
52+
mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_lib));
5053
mp_obj_list_init(mp_sys_argv, 0);
5154
#if MICROPY_VFS_FAT
5255
memset(MP_STATE_PORT(fs_user_mount), 0, sizeof(MP_STATE_PORT(fs_user_mount)));

esp8266/qstrdefsport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@
2525
*/
2626

2727
// qstrs specific to this port, only needed if they aren't auto-generated
28+
29+
// Entries for sys.path
30+
Q(/)
31+
Q(/lib)

0 commit comments

Comments
 (0)