Do not show traceback for handled pisi errors

This commit is contained in:
Fatih Aşıcı
2010-02-28 21:27:27 +00:00
parent 757e7d97a7
commit 1285cbb7fc
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -43,7 +43,6 @@ def handle_exception(exception, value, tb):
exit() exit()
elif isinstance(value, pisi.Error): elif isinstance(value, pisi.Error):
ui.error(_("Program terminated.")) ui.error(_("Program terminated."))
show_traceback = ctx.get_option('debug')
elif isinstance(value, pisi.Exception): elif isinstance(value, pisi.Exception):
show_traceback = True show_traceback = True
ui.error(_("Unhandled internal exception.\n" ui.error(_("Unhandled internal exception.\n"
@@ -64,9 +63,8 @@ def handle_exception(exception, value, tb):
if show_traceback: if show_traceback:
ui.info(_("\nTraceback:")) ui.info(_("\nTraceback:"))
traceback.print_tb(tb) traceback.print_tb(tb)
else: elif not isinstance(value, pisi.Error):
if not exception is pisi.Error: ui.info(_("Use --debug to see a traceback."))
ui.info(_("Use --debug to see a traceback."))
exit() exit()
+1 -1
View File
@@ -405,7 +405,7 @@ class Install(AtomicOperation):
if missing_old_files: if missing_old_files:
ctx.ui.warning(_("Unable to relocate following files. Reinstallation of this package is strongly recommended.")) ctx.ui.warning(_("Unable to relocate following files. Reinstallation of this package is strongly recommended."))
for f in sorted(missing_old_files): for f in sorted(missing_old_files):
ctx.ui.warning("\t- %s" % f) ctx.ui.warning(" - %s" % f)
# remove left over files from the old package. # remove left over files from the old package.
def clean_leftovers(): def clean_leftovers():