Commit fe3deeee authored by Jason R. Coombs's avatar Jason R. Coombs

Nicer syntax for processing PYTHONPATH

parent 6ab912d1
...@@ -1349,9 +1349,16 @@ class easy_install(Command): ...@@ -1349,9 +1349,16 @@ class easy_install(Command):
def get_site_dirs(): def get_site_dirs():
# return a list of 'site' dirs """
sitedirs = [_f for _f in os.environ.get('PYTHONPATH', Return a list of 'site' dirs
'').split(os.pathsep) if _f] """
sitedirs = []
# start with PYTHONPATH
pythonpath_items = os.environ.get('PYTHONPATH', '').split(os.pathsep)
sitedirs.extend(filter(None, pythonpath_items))
prefixes = [sys.prefix] prefixes = [sys.prefix]
if sys.exec_prefix != sys.prefix: if sys.exec_prefix != sys.prefix:
prefixes.append(sys.exec_prefix) prefixes.append(sys.exec_prefix)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment