aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-04-10 11:13:51 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-04-10 11:13:51 -0400
commitfe3deeeebd6d5f01e803ea6bbfcf001834ca45b7 (patch)
tree1e15060f2792f9c295963f79e6f23ef8498fdc9b /setuptools/command
parent6ab912d1f676604d71e8e2090d262002f78929d4 (diff)
downloadexternal_python_setuptools-fe3deeeebd6d5f01e803ea6bbfcf001834ca45b7.tar.gz
external_python_setuptools-fe3deeeebd6d5f01e803ea6bbfcf001834ca45b7.tar.bz2
external_python_setuptools-fe3deeeebd6d5f01e803ea6bbfcf001834ca45b7.zip
Nicer syntax for processing PYTHONPATH
Diffstat (limited to 'setuptools/command')
-rwxr-xr-xsetuptools/command/easy_install.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index ef83f7ae..55d26560 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1349,9 +1349,16 @@ class easy_install(Command):
def get_site_dirs():
- # return a list of 'site' dirs
- sitedirs = [_f for _f in os.environ.get('PYTHONPATH',
- '').split(os.pathsep) if _f]
+ """
+ Return a list of 'site' dirs
+ """
+
+ sitedirs = []
+
+ # start with PYTHONPATH
+ pythonpath_items = os.environ.get('PYTHONPATH', '').split(os.pathsep)
+ sitedirs.extend(filter(None, pythonpath_items))
+
prefixes = [sys.prefix]
if sys.exec_prefix != sys.prefix:
prefixes.append(sys.exec_prefix)