8000 py: Only load frozen modules when the filename has the prefix. by tannewt · Pull Request #235 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

py: Only load frozen modules when the filename has the prefix. #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on 8000 GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2017

Conversation

tannewt
Copy link
Member
@tannewt tannewt commented Sep 5, 2017

This allows one to override a built-in module by loading a newer
version onto the file system.

This allows one to override a built-in module by loading a newer
version onto the file system.
@tannewt tannewt requested a review from dhalbert September 6, 2017 01:35
@tannewt tannewt added this to the 2.0 milestone Sep 6, 2017
// requested filename in the list of frozen module filenames.
#if MICROPY_MODULE_FROZEN
void *modref;
int frozen_type = mp_find_frozen_module(file_str + MP_FROZEN_FAKE_DIR_SLASH_LENGTH, file->len - MP_FROZEN_FAKE_DIR_SLASH_LENGTH, &modref);
Copy link
Collaborator
@dhalbert dhalbert Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the checking for ".frozen/" here now means the checking for ".frozen/" in mp_find_frozen_module() is no longer needed. But we can just leave it in. Basically you hoisted that check up to where it was really needed.

This and pyexec_frozen_module() are the only calls to mp_find_frozen_module().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0