Mercurial > cpython-lru_cache-weakref
diff Lib/importlib/_bootstrap.py @ 78511:34d5ec8a1019
Don't overwrite a __path__ value from extension modules if already
set.
| author | Brett Cannon <brett@python.org> |
|---|---|
| date | Sat, 11 Aug 2012 19:43:29 -0400 |
| parents | f7b59e890e30 |
| children | 0d52f125dd32 |
line wrap: on
line diff
--- a/Lib/importlib/_bootstrap.py Sat Aug 11 19:41:27 2012 -0400 +++ b/Lib/importlib/_bootstrap.py Sat Aug 11 19:43:29 2012 -0400 @@ -1108,7 +1108,7 @@ module = _call_with_frames_removed(_imp.load_dynamic, fullname, self.path) _verbose_message('extension module loaded from {!r}', self.path) - if self.is_package(fullname): + if self.is_package(fullname) and not hasattr(module, '__path__'): module.__path__ = [_path_split(self.path)[0]] return module except:
