diff --git a/syntax_checkers/python/pylint.vim b/syntax_checkers/python/pylint.vim index 321bc1f3..186a7d74 100644 --- a/syntax_checkers/python/pylint.vim +++ b/syntax_checkers/python/pylint.vim @@ -7,18 +7,19 @@ if exists("g:loaded_syntastic_python_pylint_checker") finish endif -let g:loaded_syntastic_python_pylint_checker=1 +let g:loaded_syntastic_python_pylint_checker = 1 + +let s:pylint_new = -1 function! SyntaxCheckers_python_pylint_IsAvailable() - return executable('pylint') + let s:pylint_new = executable('pylint') ? s:PylintNew() : -1 + return s:pylint_new >= 0 endfunction function! SyntaxCheckers_python_pylint_GetLocList() - let pylint_new = s:PylintNew() - let makeprg = syntastic#makeprg#build({ \ 'exe': 'pylint', - \ 'args': (pylint_new ? '--msg-template="{path}:{line}: [{msg_id}] {msg}" -r n' : '-f parseable -r n -i y'), + \ 'args': (s:pylint_new ? '--msg-template="{path}:{line}: [{msg_id}] {msg}" -r n' : '-f parseable -r n -i y'), \ 'filetype': 'python', \ 'subchecker': 'pylint' }) @@ -51,10 +52,12 @@ endfunction function s:PylintNew() try let pylint_version = filter(split(system('pylint --version'), '\m, \|\n'), 'v:val =~# "^pylint"')[0] - return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1]) + let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1]) catch /E684/ - return 0 + call syntastic#util#error("checker python/pylint: can't parse version string (abnormal termination?)") + let ret = -1 endtry + return ret endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({