8000 unix/main: Insert script base dir into sys.path rather than replace. · micropython/micropython@7628dd1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7628dd1

Browse files
committed
unix/main: Insert script base dir into sys.path rather than replace.
This allows any frozen code to still be found with existing empty entry. Also applies to windows port. Addresses issue #2322
1 parent a472589 commit 7628dd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/unix/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ MP_NOINLINE int main_(int argc, char **argv) {
660660

661661
// Set base dir of the script as first entry in sys.path
662662
char *p = strrchr(basedir, '/');
663-
path_items[0] = mp_obj_new_str_via_qstr(basedir, p - basedir);
663+
mp_obj_list_insert(mp_sys_path, 0, mp_obj_new_str_via_qstr(basedir, p - basedir));
664664
free(pathbuf);
665665

666666
set_sys_argv(argv, argc, a);

0 commit comments

Comments
 (0)
0