From 4b822e533c3932f05945f4dcc3996245709b8b58 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 12 Nov 2007 04:20:03 +0000 Subject: [PATCH] Dont report exceptions in error handler. --- src/libprs500/gui2/main_window.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/libprs500/gui2/main_window.py b/src/libprs500/gui2/main_window.py index 89e436f251..7d4cb401e7 100644 --- a/src/libprs500/gui2/main_window.py +++ b/src/libprs500/gui2/main_window.py @@ -24,11 +24,14 @@ class MainWindow(QMainWindow): QMainWindow.__init__(self, parent) def unhandled_exception(self, type, value, tb): - sio = StringIO.StringIO() - traceback.print_exception(type, value, tb, file=sio) - fe = sio.getvalue() - print >>sys.stderr, fe - msg = '

' + unicode(str(value), 'utf8', 'replace') + '

' - msg += '

Detailed traceback:

'+fe+'
' - d = ConversionErrorDialog(self, 'ERROR: Unhandled exception', msg) - d.exec_() \ No newline at end of file + try: + sio = StringIO.StringIO() + traceback.print_exception(type, value, tb, file=sio) + fe = sio.getvalue() + print >>sys.stderr, fe + msg = '

' + unicode(str(value), 'utf8', 'replace') + '

' + msg += '

Detailed traceback:

'+fe+'
' + d = ConversionErrorDialog(self, 'ERROR: Unhandled exception', msg) + d.exec_() + except: + pass \ No newline at end of file