mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
python#CheckForModule: Use the given module string instead of hard-coding pynvim
This commit is contained in:
parent
0dd89cda9c
commit
edeb19d5e9
@ -75,12 +75,12 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
|
|||||||
|
|
||||||
let min_version = (a:major_version == 2) ? '2.6' : '3.3'
|
let min_version = (a:major_version == 2) ? '2.6' : '3.3'
|
||||||
|
|
||||||
" Try to load pynvim module, and output Python version.
|
" Try to load module, and output Python version.
|
||||||
" Exit codes:
|
" Exit codes:
|
||||||
" 0 pynvim module can be loaded.
|
" 0 module can be loaded.
|
||||||
" 2 pynvim module cannot be loaded.
|
" 2 module cannot be loaded.
|
||||||
" Otherwise something else went wrong (e.g. 1 or 127).
|
" Otherwise something else went wrong (e.g. 1 or 127).
|
||||||
let [prog_exitcode, prog_version] = s:import_module(a:prog, 'pynvim')
|
let [prog_exitcode, prog_version] = s:import_module(a:prog, a:module)
|
||||||
|
|
||||||
if prog_exitcode == 2 || prog_exitcode == 0
|
if prog_exitcode == 2 || prog_exitcode == 0
|
||||||
" Check version only for expected return codes.
|
" Check version only for expected return codes.
|
||||||
@ -94,7 +94,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if prog_exitcode == 2
|
if prog_exitcode == 2
|
||||||
return [0, prog_path.' does not have the "pynvim" module. :help provider-python']
|
return [0, prog_path.' does not have the "' . a:module . '" module. :help provider-python']
|
||||||
elseif prog_exitcode == 127
|
elseif prog_exitcode == 127
|
||||||
" This can happen with pyenv's shims.
|
" This can happen with pyenv's shims.
|
||||||
return [0, prog_path . ' does not exist: ' . prog_version]
|
return [0, prog_path . ' does not exist: ' . prog_version]
|
||||||
|
Loading…
Reference in New Issue
Block a user