Don't overwrite a __path__ value from extension modules if already

set.
This commit is contained in:
Brett Cannon 2012-08-11 19:43:29 -04:00
parent a6e8581449
commit b428f47cf6
2 changed files with 1671 additions and 1668 deletions

View file

@ -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:

File diff suppressed because it is too large Load diff