Checking for 'pythonw' only on Windows
On Mac OS X, checking for pythonw can return a path to an ancient 2.4 version of Python in some cases. We don't want that.
This commit is contained in:
parent
207a0779c3
commit
4aa207c2ad
@ -80,13 +80,16 @@ def GetUnusedLocalhostPort():
|
|||||||
|
|
||||||
|
|
||||||
def PathToPythonInterpreter():
|
def PathToPythonInterpreter():
|
||||||
# We check for 'pythonw' first because that covers the Windows use case (and
|
|
||||||
# 'pythonw' doesn't pop-up a console window like running 'python' does).
|
|
||||||
# We check for 'python2' before 'python' because some OS's (I'm looking at you
|
# We check for 'python2' before 'python' because some OS's (I'm looking at you
|
||||||
# Arch Linux) have made the... interesting decision to point /usr/bin/python
|
# Arch Linux) have made the... interesting decision to point /usr/bin/python
|
||||||
# to python3.
|
# to python3.
|
||||||
path_to_python = PathToFirstExistingExecutable(
|
python_names = [ 'python2', 'python' ]
|
||||||
[ 'pythonw', 'python2', 'python' ] )
|
if OnWindows():
|
||||||
|
# On Windows, 'pythonw' doesn't pop-up a console window like running
|
||||||
|
# 'python' does.
|
||||||
|
python_names.insert( 0, 'pythonw' )
|
||||||
|
|
||||||
|
path_to_python = PathToFirstExistingExecutable( python_names )
|
||||||
if path_to_python:
|
if path_to_python:
|
||||||
return path_to_python
|
return path_to_python
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user