forked from VimPlug/jedi-vim
Merge pull request #461 from blueyed/importerror-with-no_jedi_warning
Pass ImportError to no_jedi_warning and display it there
This commit is contained in:
@@ -72,7 +72,10 @@ def vim_eval(string):
|
||||
return _catch_exception(string, 1)
|
||||
|
||||
|
||||
def no_jedi_warning():
|
||||
def no_jedi_warning(error=None):
|
||||
msg = "Please install Jedi if you want to use jedi-vim."
|
||||
if error:
|
||||
msg = '{} The error was: {}'.format(msg, error)
|
||||
vim.command('echohl WarningMsg'
|
||||
'| echom "Please install Jedi if you want to use jedi-vim."'
|
||||
'| echohl None')
|
||||
@@ -86,8 +89,8 @@ def echo_highlight(msg):
|
||||
import vim
|
||||
try:
|
||||
import jedi
|
||||
except ImportError:
|
||||
no_jedi_warning()
|
||||
except ImportError as e:
|
||||
no_jedi_warning(str(e))
|
||||
jedi = None
|
||||
else:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user