Explicitly print exception from :try block

Reason: :try takes any output to the stderr as the exception, so traceback is 
never printed even though nothing is caught.
This commit is contained in:
ZyX 2014-08-26 19:57:45 +04:00
parent b6e8318ce9
commit 81d8a9e180
1 changed files with 13 additions and 8 deletions

View File

@ -62,6 +62,7 @@ endfunction
try
let s:can_replace_pyeval = !exists('g:powerline_pyeval')
call s:rcmd("try:")
call s:rcmd(" try:")
call s:rcmd(" ".s:import_cmd."")
call s:rcmd(" except ImportError:")
call s:rcmd(" import sys, vim")
@ -70,6 +71,10 @@ try
call s:rcmd(" import vim")
call s:rcmd(" VimPowerline().setup(pyeval=vim.eval('s:pyeval'), pycmd=vim.eval('s:pycmd'), can_replace_pyeval=int(vim.eval('s:can_replace_pyeval')))")
call s:rcmd(" del VimPowerline")
call s:rcmd("except Exception:")
call s:rcmd(" import traceback, sys")
call s:rcmd(" traceback.print_exc(file=sys.stdout)")
call s:rcmd(" raise")
execute s:pycmd s:pystr
unlet s:pystr
let s:launched = 1