Skip to content

Commit

Permalink
debug info: catch any errors with PythonJedi commands
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed authored and davidhalter committed Sep 28, 2019
1 parent 50abb5e commit b4b2f3e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions autoload/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
PythonJedi import vim; vim.command('let s:pythonjedi_called = 1')
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.'
Expand All @@ -207,8 +211,14 @@ function! jedi#debug_info() abort
endif
echohl None
else
PythonJedi from jedi_vim_debug import display_debug_info
PythonJedi display_debug_info()
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'
Expand Down

0 comments on commit b4b2f3e

Please sign in to comment.