diff options
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index c1d09dd..d2d5d34 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -137,7 +137,12 @@ class FrozenImporter: """Load a frozen module.""" if cls.find_module(fullname) is None: raise ImportError("{0} is not a frozen module".format(fullname)) - return imp.init_frozen(fullname) + module = imp.init_frozen(fullname) + if hasattr(module, '__path__'): + module.__package__ = module.__name__ + elif '.' in module.__name__: + module.__package__ = module.__name__.rsplit('.', 1)[0] + return module class ChainedImporter(object): |