diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2021-12-11 22:40:21 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-12-18 00:01:59 +1100 |
| commit | e0bf4611c3a8b23b3c52e6a7804aac341ac3a87d (patch) | |
| tree | be1d16834d97297a87768a9e41b0a682b1b33f47 /py/frozenmod.h | |
| parent | f853e3e106b151ec2819df729fd68815dce693fb (diff) | |
py: Only search frozen modules when '.frozen' is found in sys.path.
This changes makemanifest.py & mpy-tool.py to merge string and mpy names
into the same list (now mp_frozen_names).
The various paths for loading a frozen module (mp_find_frozen_module) and
checking existence of a frozen module (mp_frozen_stat) use a common
function that searches this list.
In addition, the frozen lookup will now only take place if the path starts
with ".frozen", which needs to be added to sys.path.
This fixes issues #1804, #2322, #3509, #6419.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/frozenmod.h')
| -rw-r--r-- | py/frozenmod.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/py/frozenmod.h b/py/frozenmod.h index 8a477d028..be735e85b 100644 --- a/py/frozenmod.h +++ b/py/frozenmod.h @@ -35,8 +35,6 @@ enum { MP_FROZEN_MPY, }; -int mp_find_frozen_module(const char *str, size_t len, void **data); -const char *mp_find_frozen_str(const char *str, size_t *len); -mp_import_stat_t mp_frozen_stat(const char *str); +mp_import_stat_t mp_find_frozen_module(const char *str, int *frozen_type, void **data); #endif // MICROPY_INCLUDED_PY_FROZENMOD_H |
