forked from VimPlug/jedi-vim
Somehow the virtual env prefix is set in VIM.
This basically corrupts VIM's Python, because it might be having a differnet prefix (Python 3.6) than sys path. I don't know who came up with this - probably it's just how Python loads venvs - but it's definitely not good. Fortunately we can just reset it and be happy.
This commit is contained in:
@@ -25,6 +25,15 @@ else:
|
|||||||
ELLIPSIS = u"…"
|
ELLIPSIS = u"…"
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
sys.prefix = sys.base_prefix
|
||||||
|
sys.exec_prefix = sys.base_exec_prefix
|
||||||
|
except AttributeError:
|
||||||
|
# Somehow sys.prefix is set in combination with VIM and virtualenvs.
|
||||||
|
# However the sys path is not affected. Just reset it to the normal value.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PythonToVimStr(unicode):
|
class PythonToVimStr(unicode):
|
||||||
""" Vim has a different string implementation of single quotes """
|
""" Vim has a different string implementation of single quotes """
|
||||||
__slots__ = []
|
__slots__ = []
|
||||||
|
|||||||
Reference in New Issue
Block a user