diff --git a/python/ycm/paths.py b/python/ycm/paths.py index e3a8a982..cd0adf29 100644 --- a/python/ycm/paths.py +++ b/python/ycm/paths.py @@ -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 ): diff --git a/python/ycm/tests/paths_test.py b/python/ycm/tests/paths_test.py index 6ff5f434..e50572bd 100644 --- a/python/ycm/tests/paths_test.py +++ b/python/ycm/tests/paths_test.py @@ -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: