mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
provider/pythonx.vim: Use shell-agnostic construction. #3190
This commit is contained in:
parent
57eaefbb23
commit
0ec6a9c3c3
@ -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".']
|
||||
|
Loading…
Reference in New Issue
Block a user