diff options
author | Min RK <benjaminrk@gmail.com> | 2016-07-27 15:10:53 +0200 |
---|---|---|
committer | Min RK <benjaminrk@gmail.com> | 2016-07-28 16:42:04 +0200 |
commit | 58c02d28c216d4195429b220d14ba7326e93a62b (patch) | |
tree | 77baeb4db681a1ed921764e72ee3b66228660203 | |
parent | 4d158f842cbadb0d4b3bbeee3a8488f5f9a3dee4 (diff) | |
download | external_python_setuptools-58c02d28c216d4195429b220d14ba7326e93a62b.tar.gz external_python_setuptools-58c02d28c216d4195429b220d14ba7326e93a62b.tar.bz2 external_python_setuptools-58c02d28c216d4195429b220d14ba7326e93a62b.zip |
insert(replace=False) should really be a no-op if path is found
that includes removing duplicates.
-rw-r--r-- | pkg_resources/__init__.py | 6 |
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 |