mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
Merge pull request #1559 from fwalch/python-messages
Improve Python host messages.
This commit is contained in:
@@ -219,7 +219,9 @@ function! s:RequirePythonHost(name)
|
|||||||
" In some distros, python3 is the default python
|
" In some distros, python3 is the default python
|
||||||
let python_host_prog = 'python2'
|
let python_host_prog = 'python2'
|
||||||
else
|
else
|
||||||
throw 'No python interpreter found'
|
throw 'No python interpreter found.' .
|
||||||
|
\ " Try setting 'let g:python_host_prog=/path/to/python' in your '.nvimrc'" .
|
||||||
|
\ " or see ':help nvim-python'."
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Make sure we pick correct python version on path.
|
" Make sure we pick correct python version on path.
|
||||||
@@ -231,7 +233,8 @@ function! s:RequirePythonHost(name)
|
|||||||
let import_result = system(python_host_prog .
|
let import_result = system(python_host_prog .
|
||||||
\ ' -c "import neovim, sys; sys.stdout.write(\"ok\")"')
|
\ ' -c "import neovim, sys; sys.stdout.write(\"ok\")"')
|
||||||
if import_result != 'ok'
|
if import_result != 'ok'
|
||||||
throw 'No neovim module found for ' . python_version
|
throw 'No neovim module found for ' . python_version . '.' .
|
||||||
|
\ " Try installing it with 'pip install neovim' or see ':help nvim-python'."
|
||||||
endif
|
endif
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -241,7 +244,9 @@ function! s:RequirePythonHost(name)
|
|||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
endtry
|
endtry
|
||||||
throw 'Failed to load python host'
|
throw 'Failed to load python host.' .
|
||||||
|
\ " Try upgrading the Neovim python module with 'pip install --upgrade neovim'" .
|
||||||
|
\ " or see ':help nvim-python'."
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call remote#host#Register('python', function('s:RequirePythonHost'))
|
call remote#host#Register('python', function('s:RequirePythonHost'))
|
||||||
|
Reference in New Issue
Block a user