provider/pythonx.vim: Use shell-agnostic construction. #3190

This commit is contained in:
sanmiguel 2015-08-18 16:43:17 +02:00 committed by Justin M. Keyes
parent 57eaefbb23
commit 0ec6a9c3c3

View File

@ -53,13 +53,13 @@ function! s:check_interpreter(prog, major_ver, skip) abort
endif
" Try to load neovim module, and output Python version.
let prog_ver = system(a:prog . ' -c ' .
\ '''import sys; sys.stdout.write(str(sys.version_info[0]) + '.
\ '"." + str(sys.version_info[1])); '''.
\ (a:major_ver == 2 ?
\ '''import pkgutil; exit(pkgutil.get_loader("neovim") is None)''':
\ '''import importlib; exit(importlib.find_loader("neovim") is None)''')
\ )
let prog_ver = system([ a:prog , '-c' ,
\ 'import sys; sys.stdout.write(str(sys.version_info[0]) + '.
\ '"." + str(sys.version_info[1])); '.
\ (a:major_ver == 2
\ ? 'import pkgutil; exit(pkgutil.get_loader("neovim") is None)'
\ : 'import importlib; exit(importlib.find_loader("neovim") is None)')
\ ])
if v:shell_error
return [0, prog_path . ' does have not have the neovim module installed. '
\ . 'See ":help nvim-python".']