Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b428f47

Browse files
committed
Don't overwrite a __path__ value from extension modules if already
set.
1 parent a6e8581 commit b428f47

2 files changed

Lines changed: 1662 additions & 1659 deletions

File tree

Lib/importlib/_bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ def load_module(self, fullname):
11081108
module = _call_with_frames_removed(_imp.load_dynamic,
11091109
fullname, self.path)
11101110
_verbose_message('extension module loaded from {!r}', self.path)
1111-
if self.is_package(fullname):
1111+
if self.is_package(fullname) and not hasattr(module, '__path__'):
11121112
module.__path__ = [_path_split(self.path)[0]]
11131113
return module
11141114
except:

0 commit comments

Comments
 (0)