From ade88fe4cc231710814325ac469104a252f41f2b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 29 Jul 2018 01:44:46 +0200 Subject: [PATCH] checkhealth: do not use exepath with host_prog (#8784) This would need to get `expand`ed to not become empty, and is being handled by s:check_bin already. `s:check_bin` will also complain about e.g. "~/.pyenv/versions/3.6.6/bin/python" not being executable, but that reflects that the host will fail to start with it. Fixes #8778 --- runtime/autoload/health/provider.vim | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 7ab06c3820..d8ab26bd00 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -291,20 +291,14 @@ function! s:check_python(version) abort if empty(pyname) call health#report_warn('No Python interpreter was found with the neovim ' \ . 'module. Using the first available for diagnostics.') - endif - - if !empty(pyname) - if exists('g:'.host_prog_var) - let python_bin = exepath(pyname) - endif - let pyname = fnamemodify(pyname, ':t') + elseif exists('g:'.host_prog_var) + let python_bin = pyname endif if !empty(pythonx_errs) call health#report_error('Python provider error', pythonx_errs) - endif - if !empty(pyname) && empty(python_bin) && empty(pythonx_errs) + elseif !empty(pyname) && empty(python_bin) if !exists('g:'.host_prog_var) call health#report_info(printf('`g:%s` is not set. Searching for ' \ . '%s in the environment.', host_prog_var, pyname))