Minor logic refactor for path to Python func
This commit is contained in:
parent
7bfb4c3402
commit
ca90d10ff7
@ -87,7 +87,9 @@ def PathToPythonInterpreter():
|
|||||||
# to python3.
|
# to python3.
|
||||||
path_to_python = PathToFirstExistingExecutable(
|
path_to_python = PathToFirstExistingExecutable(
|
||||||
[ 'pythonw', 'python2', 'python' ] )
|
[ 'pythonw', 'python2', 'python' ] )
|
||||||
if not path_to_python:
|
if path_to_python:
|
||||||
|
return path_to_python
|
||||||
|
|
||||||
# On Windows, Python may not be on the PATH at all, so we check some common
|
# On Windows, Python may not be on the PATH at all, so we check some common
|
||||||
# install locations.
|
# install locations.
|
||||||
if OnWindows():
|
if OnWindows():
|
||||||
@ -96,7 +98,6 @@ def PathToPythonInterpreter():
|
|||||||
elif os.path.exists( WIN_PYTHON26_PATH ):
|
elif os.path.exists( WIN_PYTHON26_PATH ):
|
||||||
return WIN_PYTHON26_PATH
|
return WIN_PYTHON26_PATH
|
||||||
raise RuntimeError( 'Python 2.7/2.6 not installed!' )
|
raise RuntimeError( 'Python 2.7/2.6 not installed!' )
|
||||||
return path_to_python
|
|
||||||
|
|
||||||
|
|
||||||
def PathToFirstExistingExecutable( executable_name_list ):
|
def PathToFirstExistingExecutable( executable_name_list ):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user