python#CheckForModule: Use the given module string instead of hard-coding pynvim

parent 0dd89cda
......@@ -75,12 +75,12 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
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:
" 0 pynvim module can be loaded.
" 2 pynvim module cannot be loaded.
" 0 module can be loaded.
" 2 module cannot be loaded.
" 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
" Check version only for expected return codes.
......@@ -94,7 +94,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
endif
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
" This can happen with pyenv's shims.
return [0, prog_path . ' does not exist: ' . prog_version]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment