aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-04-05 15:17:39 -0400
committerGitHub <noreply@github.com>2019-04-05 15:17:39 -0400
commit7326bdfa8cc1decdbaa254d9b25e771696c85563 (patch)
tree217d16eccc86405ac36856ee6204d71743a1a51d
parent7a80e29b31f255a3fff5147e50d0135271b7c101 (diff)
parent1b4ef9635452958482a121f41e65d0b6cca1a9d6 (diff)
downloadexternal_python_setuptools-7326bdfa8cc1decdbaa254d9b25e771696c85563.tar.gz
external_python_setuptools-7326bdfa8cc1decdbaa254d9b25e771696c85563.tar.bz2
external_python_setuptools-7326bdfa8cc1decdbaa254d9b25e771696c85563.zip
Merge pull request #1709 from radiasoft/master
uniquify paths in PYTHONPATH
-rw-r--r--changelog.d/1709.bugfix.rst1
-rw-r--r--setuptools/command/test.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.d/1709.bugfix.rst b/changelog.d/1709.bugfix.rst
new file mode 100644
index 00000000..c6670ae9
--- /dev/null
+++ b/changelog.d/1709.bugfix.rst
@@ -0,0 +1 @@
+In test.paths_on_python_path, avoid adding unnecessary duplicates to the PYTHONPATH.
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index dde0118c..973e4eb2 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -15,6 +15,7 @@ from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_packages, evaluate_marker,
add_activation_listener, require, EntryPoint)
from setuptools import Command
+from .build_py import _unique_everseen
__metaclass__ = type
@@ -186,7 +187,7 @@ class test(Command):
orig_pythonpath = os.environ.get('PYTHONPATH', nothing)
current_pythonpath = os.environ.get('PYTHONPATH', '')
try:
- prefix = os.pathsep.join(paths)
+ prefix = os.pathsep.join(_unique_everseen(paths))
to_join = filter(None, [prefix, current_pythonpath])
new_path = os.pathsep.join(to_join)
if new_path: