look for python in system PATH again
This commit is contained in:
parent
03acea6e25
commit
94343e5b07
1 changed files with 7 additions and 2 deletions
|
@ -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,12 +220,16 @@ def find_python_from_registry(location, reg=None):
|
||||||
|
|
||||||
|
|
||||||
def find_python_in_folder(folder):
|
def find_python_in_folder(folder):
|
||||||
|
path = os.path.realpath('pythonw')
|
||||||
|
if folder is not None:
|
||||||
path = os.path.realpath(os.path.join(folder, 'pythonw'))
|
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('python')
|
||||||
|
if folder is not None:
|
||||||
path = os.path.realpath(os.path.join(folder, 'python'))
|
path = os.path.realpath(os.path.join(folder, 'python'))
|
||||||
try:
|
try:
|
||||||
Popen([path, '--version'])
|
Popen([path, '--version'])
|
||||||
|
|
Loading…
Reference in a new issue