aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <github@thequod.de>2018-06-24 10:28:21 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-06-24 10:28:21 +0200
commitbf6048e81d63c26231209ea82d05fb8e948dc573 (patch)
tree03d609f0b36e1382eb60dd1685f54bfb431aa0af
parentddde74764409ab380daf4b5b52022b9d40989974 (diff)
downloadrneovim-bf6048e81d63c26231209ea82d05fb8e948dc573.tar.gz
rneovim-bf6048e81d63c26231209ea82d05fb8e948dc573.tar.bz2
rneovim-bf6048e81d63c26231209ea82d05fb8e948dc573.zip
checkhealth: Python: fix VIRTUAL_ENV check (#8628)
Compare `$VIRTUAL_ENV` to `python_bin`. This is necessary when `g:python_host_prog` is set to an absolute path, and looking up `pyname` in `$PATH` yields another result.
-rw-r--r--runtime/autoload/health/provider.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 55fa1ff65e..7ab06c3820 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -383,8 +383,10 @@ function! s:check_python(version) abort
endif
" Check if $VIRTUAL_ENV is valid.
- if exists('$VIRTUAL_ENV')
- if !empty(pyname) && $VIRTUAL_ENV !=# matchstr(exepath(pyname), '^\V'.$VIRTUAL_ENV)
+ if exists('$VIRTUAL_ENV') && !empty(python_bin)
+ if $VIRTUAL_ENV ==# matchstr(python_bin, '^\V'.$VIRTUAL_ENV)
+ call health#report_info('$VIRTUAL_ENV matches executable')
+ else
call health#report_warn(
\ '$VIRTUAL_ENV exists but appears to be inactive. '
\ . 'This could lead to unexpected results.',