look for python in system PATH again

This commit is contained in:
Alan Hamlett 2015-10-06 03:59:04 -07:00
parent 03acea6e25
commit 94343e5b07
1 changed files with 7 additions and 2 deletions

View File

@ -131,6 +131,7 @@ def python_binary():
# look for python in PATH and common install locations # look for python in PATH and common install locations
paths = [ paths = [
None,
'/', '/',
'/usr/local/bin/', '/usr/local/bin/',
'/usr/bin/', '/usr/bin/',
@ -219,13 +220,17 @@ def find_python_from_registry(location, reg=None):
def find_python_in_folder(folder): def find_python_in_folder(folder):
path = os.path.realpath(os.path.join(folder, 'pythonw')) path = os.path.realpath('pythonw')
if folder is not None:
path = os.path.realpath(os.path.join(folder, 'pythonw'))
try: try:
Popen([path, '--version']) Popen([path, '--version'])
return path return path
except: except:
pass pass
path = os.path.realpath(os.path.join(folder, 'python')) path = os.path.realpath('python')
if folder is not None:
path = os.path.realpath(os.path.join(folder, 'python'))
try: try:
Popen([path, '--version']) Popen([path, '--version'])
return path return path