diff options
author | Jakob Schnitzer <mail@jakobschnitzer.de> | 2015-09-11 11:14:29 +0200 |
---|---|---|
committer | Jakob Schnitzer <mail@jakobschnitzer.de> | 2015-09-14 12:06:49 +0200 |
commit | c478dd5ab472a643488cb6b14e299ee46d83701c (patch) | |
tree | 6d17d1071682c549941231f020e1de0f331c83e7 /runtime/autoload/provider/pythonx.vim | |
parent | 5c82ea8f9f9f3ef043d4f206ded223a89a3bd360 (diff) | |
download | rneovim-c478dd5ab472a643488cb6b14e299ee46d83701c.tar.gz rneovim-c478dd5ab472a643488cb6b14e299ee46d83701c.tar.bz2 rneovim-c478dd5ab472a643488cb6b14e299ee46d83701c.zip |
python: remove current working directory from path
Before, running Nvim in a directory containing a Python module `neovim`,
or one that is imported by it or a plugin, will load that module and not
the system one. So Nvim might be tricked into running arbitrary scripts
from the current working directory.
Fixes #1665
Fixes #2530
Diffstat (limited to 'runtime/autoload/provider/pythonx.vim')
-rw-r--r-- | runtime/autoload/provider/pythonx.vim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index df3264b7a2..5ca397ea4e 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -54,7 +54,7 @@ function! s:check_interpreter(prog, major_ver, skip) abort " Try to load neovim module, and output Python version. let prog_ver = system([ a:prog , '-c' , - \ 'import sys; sys.stdout.write(str(sys.version_info[0]) + '. + \ 'import sys; sys.path.remove(""); sys.stdout.write(str(sys.version_info[0]) + '. \ '"." + str(sys.version_info[1])); '. \ (a:major_ver == 2 \ ? 'import pkgutil; exit(pkgutil.get_loader("neovim") is None)' |