8000 Question about overriding frozen source modules · Issue #1804 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
Question about overriding frozen source modules #1804
Closed
@dhylands

Description

@dhylands

When you build a firmware image that has some frozen module (say foo), and you provide a foo.py on the local filesystem, import foo still imports the internal one.

Normally you can control whether your module or a system module gets imported by manipulating sys.path, but for frozen modules there doesn't seem to be any choice.

The best I've come up with so far is to have the file be called foo2 and do import foo2 as foo. Then since foo is already loaded further imports of foo will just return that.

So I was just looking to find out if having the frozen foo.py take precedence was the intention or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0