summaryrefslogtreecommitdiff
path: root/pkg_resources/__init__.py
diff options
context:
space:
mode:
authorErik Bray <embray@stsci.edu>2015-12-31 14:17:41 -0500
committerErik Bray <embray@stsci.edu>2015-12-31 14:17:41 -0500
commitd3de33538948081d9ef39168fde870c977e30115 (patch)
tree314e5090159b5c7e09560d04d303fffba2c06f87 /pkg_resources/__init__.py
parente0e02ba96d8ee3b7be76adeec1ec9b9c3c004516 (diff)
downloadpython-setuptools-git-d3de33538948081d9ef39168fde870c977e30115.tar.gz
Fixes the original root cause of #231, and re-enables the test when the tempdir is a symlink (this does not explicitly test that /tmp itself is a symlink, but the effect is the same--only one of the path levels needs to be a symlink to reproduce this isssue)
Diffstat (limited to 'pkg_resources/__init__.py')
-rw-r--r--pkg_resources/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 7becc951..7d2fa7e9 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2182,9 +2182,14 @@ def _handle_ns(packageName, path_item):
path = module.__path__
path.append(subpath)
loader.load_module(packageName)
+
+ # Ensure that all paths on __path__ have been run through
+ # normalize_path
+ normalized_paths = set(_normalize_cached(p) for p in module.__path__)
for path_item in path:
- if path_item not in module.__path__:
- module.__path__.append(path_item)
+ normalized = _normalize_cached(path_item)
+ if normalized not in normalized_paths:
+ module.__path__.append(normalized)
return subpath
def declare_namespace(packageName):