Accept capitalized name for Python executable
Python executable name may be capitalized on macOS.
This commit is contained in:
parent
01570aac03
commit
fb000ca9e7
@ -34,7 +34,7 @@ DIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party',
|
|||||||
'ycmd' )
|
'ycmd' )
|
||||||
WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )
|
WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )
|
||||||
PYTHON_BINARY_REGEX = re.compile(
|
PYTHON_BINARY_REGEX = re.compile(
|
||||||
r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$' )
|
r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$', re.IGNORECASE )
|
||||||
|
|
||||||
|
|
||||||
def Memoize( obj ):
|
def Memoize( obj ):
|
||||||
|
@ -30,11 +30,13 @@ from ycm.paths import _EndsWithPython
|
|||||||
|
|
||||||
|
|
||||||
def EndsWithPython_Good( path ):
|
def EndsWithPython_Good( path ):
|
||||||
ok_( _EndsWithPython( path ) )
|
ok_( _EndsWithPython( path ),
|
||||||
|
'Path {0} does not end with a Python name.'.format( path ) )
|
||||||
|
|
||||||
|
|
||||||
def EndsWithPython_Bad( path ):
|
def EndsWithPython_Bad( path ):
|
||||||
ok_( not _EndsWithPython( path ) )
|
ok_( not _EndsWithPython( path ),
|
||||||
|
'Path {0} does end with a Python name.'.format( path ) )
|
||||||
|
|
||||||
|
|
||||||
def EndsWithPython_Python2Paths_test():
|
def EndsWithPython_Python2Paths_test():
|
||||||
@ -43,7 +45,8 @@ def EndsWithPython_Python2Paths_test():
|
|||||||
'python2',
|
'python2',
|
||||||
'/usr/bin/python2.6',
|
'/usr/bin/python2.6',
|
||||||
'/home/user/.pyenv/shims/python2.7',
|
'/home/user/.pyenv/shims/python2.7',
|
||||||
r'C:\Python26\python.exe'
|
r'C:\Python26\python.exe',
|
||||||
|
'/Contents/MacOS/Python'
|
||||||
]
|
]
|
||||||
|
|
||||||
for path in python_paths:
|
for path in python_paths:
|
||||||
|
Loading…
Reference in New Issue
Block a user