Skip to content

Commit a93144c

Browse files
committed
py/reader: Allow MICROPY_VFS_POSIX to work with MICROPY_READER_POSIX.
1 parent 8d82b0e commit a93144c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

py/reader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,15 @@ void mp_reader_new_file_from_fd(mp_reader_t *reader, int fd, bool close_fd) {
124124
reader->close = mp_reader_posix_close;
125125
}
126126

127+
#if !MICROPY_VFS_POSIX
128+
// If MICROPY_VFS_POSIX is defined then this function is provided by the VFS layer
127129
void mp_reader_new_file(mp_reader_t *reader, const char *filename) {
128130
int fd = open(filename, O_RDONLY, 0644);
129131
if (fd < 0) {
130132
mp_raise_OSError(errno);
131133
}
132134
mp_reader_new_file_from_fd(reader, fd, true);
133135
}
136+
#endif
134137

135138
#endif

0 commit comments

Comments
 (0)