summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-08-11 23:43:29 (GMT)
committerBrett Cannon <brett@python.org>2012-08-11 23:43:29 (GMT)
commitb428f47cf61b82da25406edafc561674d085452a (patch)
treebc5fd95f5fb5f88e050bc620c3d7cbaef9d161d8 /Lib
parenta6e8581449fe427668a0ccd53cdbd6d477835966 (diff)
downloadcpython-b428f47cf61b82da25406edafc561674d085452a.zip
cpython-b428f47cf61b82da25406edafc561674d085452a.tar.gz
cpython-b428f47cf61b82da25406edafc561674d085452a.tar.bz2
Don't overwrite a __path__ value from extension modules if already
set.
Diffstat (limited to 'Lib')
-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 c0b1a5a..8ecc882 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: