mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-06 18:54:44 +08:00
initialize.py: catch and handle any exception when import jedi_vim
This adds the traceback to it, which then will be displayed with `v:exception` in the Vim part.
This commit is contained in:
@@ -18,5 +18,10 @@ import traceback
|
||||
|
||||
# update the sys path to include the jedi_vim script
|
||||
sys.path.insert(0, vim.eval('expand(s:script_path)'))
|
||||
import jedi_vim
|
||||
sys.path.pop(1)
|
||||
try:
|
||||
import jedi_vim
|
||||
except Exception as excinfo:
|
||||
raise Exception('Failed to import jedi_vim: {0}\n{1}'.format(
|
||||
excinfo, traceback.format_exc()))
|
||||
finally:
|
||||
sys.path.pop(1)
|
||||
|
||||
Reference in New Issue
Block a user