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