avoid listing non-existing path in PATH.

This commit is contained in:
Mathieu Virbel 2013-05-07 08:48:16 +02:00
parent da698b29a6
commit 4a132275cb

View file

@ -11,6 +11,8 @@ def resolve_cython():
global cython global cython
for executable in ('cython', 'cython-2.7'): for executable in ('cython', 'cython-2.7'):
for path in os.environ['PATH'].split(':'): for path in os.environ['PATH'].split(':'):
if not os.path.exists(path):
continue
if executable in os.listdir(path): if executable in os.listdir(path):
cython = os.path.join(path, executable) cython = os.path.join(path, executable)
return return