summaryrefslogtreecommitdiff
path: root/pkg_resources/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources/__init__.py')
-rw-r--r--pkg_resources/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 6aabd4c5..6d472734 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2620,7 +2620,11 @@ class Distribution(object):
for p, item in enumerate(npath):
if item == nloc:
- break
+ if replace:
+ break
+ else:
+ # don't modify path (even removing duplicates) if found and not replace
+ return
elif item == bdir and self.precedence == EGG_DIST:
# if it's an .egg, give it precedence over its directory
# UNLESS it's already been added to sys.path and replace=False