mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 11:26:37 +00:00
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
This commit is contained in:
@@ -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)'
|
||||
|
Reference in New Issue
Block a user