Rename initialize.py to jedi_vim_init.py

Ref: https://github.com/davidhalter/jedi-vim/issues/726#issuecomment-320505021.
This commit is contained in:
Daniel Hahler
2017-08-06 17:04:27 +02:00
parent 20312dcca8
commit dc7b6228b2
2 changed files with 1 additions and 1 deletions

26
jedi_vim_init.py Normal file
View File

@@ -0,0 +1,26 @@
"""Python initialization for jedi module."""
try:
import traceback
except Exception as excinfo:
raise Exception('Failed to import traceback: {0}'.format(excinfo))
try:
import os, sys, vim
jedi_path = os.path.join(vim.eval('expand(s:script_path)'), 'jedi')
sys.path.insert(0, jedi_path)
jedi_vim_path = vim.eval('expand(s:script_path)')
if jedi_vim_path not in sys.path: # Might happen when reloading.
sys.path.insert(0, jedi_vim_path)
except Exception as excinfo:
raise Exception('Failed to add to sys.path: {0}\n{1}'.format(
excinfo, traceback.format_exc()))
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.remove(jedi_path)