mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Don't overwrite a __path__ value from extension modules if already
set.
This commit is contained in:
parent
a6e8581449
commit
b428f47cf6
2 changed files with 1671 additions and 1668 deletions
|
@ -1108,7 +1108,7 @@ class ExtensionFileLoader:
|
|||
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:
|
||||
|
|
3337
Python/importlib.h
3337
Python/importlib.h
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue