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:
Dave Halter
2018-04-01 12:58:00 +02:00
parent 7894b38c0c
commit 57cbf1421f

View File

@@ -25,6 +25,15 @@ else:
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):
""" Vim has a different string implementation of single quotes """
__slots__ = []