Skip to content

Commit 63c992b

Browse files
committed
py/builtinimport.c: Refactor module importing.
Simplify and document/comment the handling of builtin import for: - already-loaded modules - built-in modules - built-in umodules (formerly weak links) - filesystem modules Retains existing functionality with smaller code size but should also facilitate potential new features (built-in packages, controlling the frozen path). Also makes the (unix-only) -m behavior a bit more obvious. Code size reduction of 208 bytes on PYBV11.
1 parent 5900257 commit 63c992b

File tree

5 files changed

+325
-259
lines changed

5 files changed

+325
-259
lines changed

ports/unix/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
#define MICROPY_OPT_MAP_LOOKUP_CACHE (1)
8787
#endif
8888
#define MICROPY_MODULE_WEAK_LINKS (1)
89+
#define MICROPY_ENABLE_MODULE_OVERRIDE_MAIN (1)
8990
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
9091
#define MICROPY_VFS_POSIX_FILE (1)
9192
#define MICROPY_PY_FUNCTION_ATTRS (1)

0 commit comments

Comments
 (0)