summaryrefslogtreecommitdiff
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-08-11 19:43:29 -0400
committerBrett Cannon <brett@python.org>2012-08-11 19:43:29 -0400
commitb428f47cf61b82da25406edafc561674d085452a (patch)
treebc5fd95f5fb5f88e050bc620c3d7cbaef9d161d8 /Lib/importlib
parenta6e8581449fe427668a0ccd53cdbd6d477835966 (diff)
downloadcpython-git-b428f47cf61b82da25406edafc561674d085452a.tar.gz
Don't overwrite a __path__ value from extension modules if already
set.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index c0b1a5aa9b..8ecc882b39 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -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: