mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 05:00:26 +01:00
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>
This commit is contained in:
committed by
Damien George
parent
e8355eb163
commit
a52cd5b07d
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user