Merge pull request #602 from blueyed/improve-jedi-load-error

Improve error msg when the jedi submodule fails to load
This commit is contained in:
Dave Halter
2016-08-06 18:23:42 +02:00
committed by GitHub
2 changed files with 37 additions and 15 deletions

View File

@@ -89,8 +89,8 @@ def no_jedi_warning(error=None):
def echo_highlight(msg):
vim_command('echohl WarningMsg | echom "{0}" | echohl None'.format(
msg.replace('"', '\\"')))
vim_command('echohl WarningMsg | echom "jedi-vim: {0}" | echohl None'.format(
str(msg).replace('"', '\\"')))
try:
@@ -102,7 +102,10 @@ else:
try:
version = jedi.__version__
except Exception as e: # e.g. AttributeError
echo_highlight("Could not load jedi python module: {0}".format(e))
echo_highlight(
"Error when loading the jedi python module ({0}). "
"Please ensure that Jedi is installed correctly (see Installation "
"in the README.".format(e))
jedi = None
else:
if isinstance(version, str):