Skip to content

Commit 6ba6857

Browse files
committed
print out path
1 parent 4215648 commit 6ba6857

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

unix/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,15 @@ MP_NOINLINE int main_(int argc, char **argv) {
608608
path_items[0] = MP_OBJ_NEW_QSTR(qstr_from_strn(basedir, p - basedir));
609609
free(pathbuf);
610610

611+
mp_obj_list_get(mp_sys_path, &path_num, &path_items);
612+
for (mp_uint_t i = 0; i < path_num; i++) {
613+
if (MP_OBJ_IS_QSTR(path_items[i])) {
614+
mp_printf(&mp_plat_print, "path %d %q\n", i, MP_OBJ_QSTR_VALUE(path_items[i]));
615+
} else if (MP_OBJ_IS_TYPE(path_items[i], &mp_type_str)) {
616+
mp_printf(&mp_plat_print, "path %d %s\n", i, mp_obj_str_get_str(path_items[i]));
617+
}
618+
}
619+
611620
set_sys_argv(argv, argc, a);
612621
ret = do_file(argv[a]);
613622
break;

0 commit comments

Comments
 (0)