show the traceback after the mod_echo output to that the traceback isn't
obscured by mod_echo flooding. (trunk r12814)
svn path=/main/branches/2.1.6/; revision=13046
except ParseError, e:
sys.stderr.write("%s\n" % str(e))
sys.exit(1)
+ except SystemExit:
+ raise
+ except Exception:
+ # If an unexpected exception occurs then we don't want the mod_echo
+ # output to obscure the traceback, so dump the mod_echo output before
+ # showing the traceback.
+ import traceback
+ tb_str = traceback.format_exc()
+ try:
+ from portage.elog import mod_echo
+ except ImportError:
+ pass
+ else:
+ mod_echo.finalize()
+ sys.stderr.write(tb_str)
+ sys.exit(1)
sys.exit(retval)