aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2018-04-30 16:54:35 +0200
committerDaniel Hahler <git@thequod.de>2018-04-30 16:54:35 +0200
commit1f2301eacfdfb18d6dbd2116d9ab231a97183499 (patch)
tree372ddb38632828c5f7aeaa58c19de203418e32cd
parent7d8327fd3010c095b0dcdeedd290667d5e15e87d (diff)
downloadrneovim-1f2301eacfdfb18d6dbd2116d9ab231a97183499.tar.gz
rneovim-1f2301eacfdfb18d6dbd2116d9ab231a97183499.tar.bz2
rneovim-1f2301eacfdfb18d6dbd2116d9ab231a97183499.zip
health#provider: fix sys.path for Python
Remove "" from sys.path (typically the first entry), which could cause e.g. "logging" to be added from the current directory. This gets done already for loading the host in runtime/autoload/provider/pythonx.vim.
-rw-r--r--runtime/autoload/health/provider.vim4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim
index 9296144aaf..7067ff6c1d 100644
--- a/runtime/autoload/health/provider.vim
+++ b/runtime/autoload/health/provider.vim
@@ -186,7 +186,9 @@ function! s:version_info(python) abort
endif
let nvim_path = s:trim(s:system([
- \ a:python, '-c', 'import neovim; print(neovim.__file__)']))
+ \ a:python, '-c',
+ \ 'import sys; sys.path.remove(""); ' .
+ \ 'import neovim; print(neovim.__file__)']))
if s:shell_error || empty(nvim_path)
return [python_version, 'unable to load neovim Python module', pypi_version,
\ nvim_path]