Skip to content

Commit 46a37a0

Browse files
committed
qemu/mpconfigport: Enable VFS reader, loading .mpy files and io.IOBase.
This allows importing from the VFS, and enables the following 7 additional tests: builtin_execfile, io_iobase, json_dump_iobase, import_mpy_invalid, import_mpy_native, import_mpy_native_gc, vfs_userfs. Signed-off-by: Damien George <[email protected]>
1 parent ee8d8b3 commit 46a37a0

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

ports/qemu/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ void gc_collect(void) {
7171
gc_collect_end();
7272
}
7373

74-
mp_lexer_t *mp_lexer_new_from_file(qstr filename) {
75-
mp_raise_OSError(MP_ENOENT);
76-
}
77-
7874
void nlr_jump_fail(void *val) {
7975
mp_printf(&mp_plat_print, "uncaught NLR\n");
8076
exit(1);

ports/qemu/mpconfigport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@
4242
#endif
4343

4444
#define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
45+
#define MICROPY_PERSISTENT_CODE_LOAD (1)
4546
#define MICROPY_MEM_STATS (1)
47+
#define MICROPY_READER_VFS (1)
4648
#define MICROPY_ENABLE_GC (1)
4749
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
4850
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
4951
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
5052
#define MICROPY_WARNINGS (1)
51-
#define MICROPY_PY_IO_IOBASE (0)
5253
#define MICROPY_PY_SYS_PLATFORM "qemu"
5354
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
5455
#define MICROPY_PY_SELECT (0)

0 commit comments

Comments
 (0)