forked from VimPlug/jedi-vim
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
|
# update the sys path to include the jedi_vim script
|
||||||
sys.path.insert(0, vim.eval('expand(s:script_path)'))
|
sys.path.insert(0, vim.eval('expand(s:script_path)'))
|
||||||
import jedi_vim
|
try:
|
||||||
sys.path.pop(1)
|
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