Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loader: PyiFrozenImporter: work-around for importlib's LazyLoader
When `importlib.util.LazyLoader` is used, the `module` passed to the `PyiFrozenImporter.exec_module` contains modified spec, in which the `loader_state` is a `dict` prepared by the `LazyLoader` code. This means that our original `loader_state` is lost, and we need to determine the module name for look-up in the PYZ by other means. Specifically, we convert the `origin` back to the module name, which allows us to handle aliased modules as well.
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Attempt to fix compatibility of PyInstaller's ``PyiFrozenImporter`` with | ||
``importlib.util.LazyLoader``. |