summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-11 07:44:10 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-11 07:44:10 +0000
commit60a2919b5d2b035ee0036de27bfa7aca4796e364 (patch)
tree43d351df9e4a0924ce2df406ee4d34f6e71f11e5
parentWhen the config_incrementals parameter is unspecified in the config (diff)
downloadportage-multirepo-60a2919b5d2b035ee0036de27bfa7aca4796e364.tar.gz
portage-multirepo-60a2919b5d2b035ee0036de27bfa7aca4796e364.tar.bz2
portage-multirepo-60a2919b5d2b035ee0036de27bfa7aca4796e364.zip
Bug #261852 - If an unexpected exception is raise from emerge_main() then
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
-rwxr-xr-xbin/emerge16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index b07ad9e0..b95a2f5b 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -44,4 +44,20 @@ if __name__ == "__main__":
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)