provider/pythonx: Show absolute path to executable in error message.

This commit is contained in:
Florian Walch
2015-06-05 12:16:52 +03:00
parent cfa278c72e
commit e8c68aa7ee

View File

@@ -43,8 +43,9 @@ function! provider#pythonx#Detect(major_ver) abort
endfunction endfunction
function! s:check_interpreter(prog, major_ver, skip) abort function! s:check_interpreter(prog, major_ver, skip) abort
if !executable(a:prog) let prog_path = exepath(a:prog)
return [0, a:prog . ' does not exist or is not executable.'] if prog_path == ''
return [0, a:prog . ' not found in search path or not executable.']
endif endif
if a:skip if a:skip
@@ -60,7 +61,7 @@ function! s:check_interpreter(prog, major_ver, skip) abort
\ '''import importlib; exit(importlib.find_loader("neovim") is None)''') \ '''import importlib; exit(importlib.find_loader("neovim") is None)''')
\ ) \ )
if v:shell_error if v:shell_error
return [0, a:prog . ' does have not have the neovim module installed. ' return [0, prog_path . ' does have not have the neovim module installed. '
\ . 'See ":help nvim-python".'] \ . 'See ":help nvim-python".']
endif endif
@@ -69,6 +70,6 @@ function! s:check_interpreter(prog, major_ver, skip) abort
return [1, ''] return [1, '']
endif endif
return [0, a:prog . ' is Python ' . prog_ver . ' and cannot provide Python ' return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python '
\ . a:major_ver . '.'] \ . a:major_ver . '.']
endfunction endfunction