summaryrefslogtreecommitdiff
path: root/shared-module/os/__init__.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-07-30 12:33:44 -0700
committerGitHub <noreply@github.com>2018-07-30 12:33:44 -0700
commita6d94b68453b8535398ff0b61cd6c4a0c7f77f8b (patch)
tree8defd6392975b8145dc11f0cce9c39a4e440b32a /shared-module/os/__init__.c
parent433a29bb70d51abb84c77a911ced43c6ff14706e (diff)
parentb1006170f1dcfa3a9499ef31c19c8f20736b136a (diff)
Merge pull request #1068 from dhalbert/micropython-25ae98f-merge
Micropython 25ae98f merge
Diffstat (limited to 'shared-module/os/__init__.c')
-rw-r--r--shared-module/os/__init__.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/shared-module/os/__init__.c b/shared-module/os/__init__.c
index 1dadd254a..a38f3781f 100644
--- a/shared-module/os/__init__.c
+++ b/shared-module/os/__init__.c
@@ -77,7 +77,7 @@ void common_hal_os_chdir(const char* path) {
// subsequent relative paths begin at the root of that VFS.
for (vfs = MP_STATE_VM(vfs_mount_table); vfs != NULL; vfs = vfs->next) {
if (vfs->len == 1) {
- mp_obj_t root = mp_obj_new_str("/", 1, false);
+ mp_obj_t root = mp_obj_new_str("/", 1);
mp_vfs_proxy_call(vfs, MP_QSTR_chdir, 1, &root);
break;
}
@@ -112,9 +112,8 @@ mp_obj_t common_hal_os_listdir(const char* path) {
mp_obj_t dir_list = mp_obj_new_list(0, NULL);
mp_obj_t next;
while ((next = mp_iternext(iter_obj)) != MP_OBJ_STOP_ITERATION) {
- mp_obj_t *items;
- mp_obj_get_array_fixed_n(next, 3, &items);
- mp_obj_list_append(dir_list, items[0]);
+ // next[0] is the filename.
+ mp_obj_list_append(dir_list, mp_obj_subscr(next, MP_OBJ_NEW_SMALL_INT(0), MP_OBJ_SENTINEL));
}
return dir_list;
}