debug info: catch any errors with PythonJedi commands

Ref: https://github.com/davidhalter/jedi-vim/issues/953
This commit is contained in:
Daniel Hahler
2019-09-27 02:03:32 +02:00
committed by Dave Halter
parent 50abb5e95a
commit b4b2f3ef54

View File

@@ -198,7 +198,11 @@ function! jedi#debug_info() abort
echo 'Using Python version '.s:python_version.' to access Jedi.'
let pyeval = s:python_version == 3 ? 'py3eval' : 'pyeval'
let s:pythonjedi_called = 0
try
PythonJedi import vim; vim.command('let s:pythonjedi_called = 1')
catch
echo 'Error when trying to import vim: '.v:exception
endtry
if !s:pythonjedi_called
echohl WarningMsg
echom 'PythonJedi failed to run, likely a Python config issue.'
@@ -207,8 +211,14 @@ function! jedi#debug_info() abort
endif
echohl None
else
try
PythonJedi from jedi_vim_debug import display_debug_info
PythonJedi display_debug_info()
catch
echohl WarningMsg
echo 'Error when running display_debug_info: '.v:exception
echohl None
endtry
endif
echo "\n"
echo '##### Settings'