Accept capitalized name for Python executable

Python executable name may be capitalized on macOS.
This commit is contained in:
micbou 2017-03-27 22:23:39 +02:00
parent 01570aac03
commit fb000ca9e7
No known key found for this signature in database
GPG Key ID: C7E8FD1F3BDA1E05
2 changed files with 7 additions and 4 deletions

View File

@ -34,7 +34,7 @@ DIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party',
'ycmd' )
WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )
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 ):

View File

@ -30,11 +30,13 @@ from ycm.paths import _EndsWithPython
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 ):
ok_( not _EndsWithPython( path ) )
ok_( not _EndsWithPython( path ),
'Path {0} does end with a Python name.'.format( path ) )
def EndsWithPython_Python2Paths_test():
@ -43,7 +45,8 @@ def EndsWithPython_Python2Paths_test():
'python2',
'/usr/bin/python2.6',
'/home/user/.pyenv/shims/python2.7',
r'C:\Python26\python.exe'
r'C:\Python26\python.exe',
'/Contents/MacOS/Python'
]
for path in python_paths: