mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +08:00
Merge pull request #547 from blueyed/improve-error-on-init
Improve error messages during init
This commit is contained in:
@@ -126,12 +126,11 @@ function! jedi#init_python()
|
||||
try
|
||||
let s:_init_python = s:init_python()
|
||||
catch
|
||||
if !exists("g:jedi#squelch_py_warning")
|
||||
echohl WarningMsg
|
||||
echom "Error: jedi-vim failed to initialize Python: ".v:exception." (in ".v:throwpoint.")"
|
||||
echohl None
|
||||
endif
|
||||
let s:_init_python = 0
|
||||
if !exists("g:jedi#squelch_py_warning")
|
||||
echoerr "Error: jedi-vim failed to initialize Python: "
|
||||
\ .v:exception." (in ".v:throwpoint.")"
|
||||
endif
|
||||
endtry
|
||||
endif
|
||||
return s:_init_python
|
||||
@@ -154,11 +153,11 @@ function! jedi#setup_py_version(py_version)
|
||||
|
||||
try
|
||||
execute cmd_init.' '.s:script_path.'/initialize.py'
|
||||
execute 'command! -nargs=1 PythonJedi '.cmd_exec.' <args>'
|
||||
return 1
|
||||
catch
|
||||
throw "jedi#setup_py_version: ".v:exception
|
||||
endtry
|
||||
execute 'command! -nargs=1 PythonJedi '.cmd_exec.' <args>'
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -202,12 +201,7 @@ function! jedi#_vim_exceptions(str, is_eval)
|
||||
return l:result
|
||||
endfunction
|
||||
|
||||
|
||||
if !jedi#init_python()
|
||||
" Do not define any functions when Python initialization failed.
|
||||
finish
|
||||
endif
|
||||
|
||||
call jedi#init_python() " Might throw an error.
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" functions that call python code
|
||||
|
||||
Reference in New Issue
Block a user