diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2021-07-14 17:14:16 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-09-19 19:06:07 +1000 |
| commit | a52cd5b07d6d6e2502fff2bbfb9e5b96562452a4 (patch) | |
| tree | abfbfe05586fe9c19d31adb32e82c59481ad611a /extmod/vfs.c | |
| parent | e8355eb16357b0bd234a9bcab1c9e8b72fcdbabc (diff) | |
py/obj: Add accessors for type slots and use everywhere.
This is a no-op, but sets the stage for changing the mp_obj_type_t
representation.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/vfs.c')
| -rw-r--r-- | extmod/vfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extmod/vfs.c b/extmod/vfs.c index 0ef20e928..00450e100 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -132,8 +132,9 @@ mp_import_stat_t mp_vfs_import_stat(const char *path) { } // If the mounted object has the VFS protocol, call its import_stat helper - const mp_vfs_proto_t *proto = mp_obj_get_type(vfs->obj)->protocol; - if (proto != NULL) { + const mp_obj_type_t *type = mp_obj_get_type(vfs->obj); + if (MP_OBJ_TYPE_HAS_SLOT(type, protocol)) { + const mp_vfs_proto_t *proto = MP_OBJ_TYPE_GET_SLOT(type, protocol); return proto->import_stat(MP_OBJ_TO_PTR(vfs->obj), path_out); } |
