mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
55f9f88d91
commit
33bb570277
@ -130,8 +130,8 @@ class MainWindow(QMainWindow):
|
|||||||
def set_exception_handler(self):
|
def set_exception_handler(self):
|
||||||
sys.excepthook = ExceptionHandler(self)
|
sys.excepthook = ExceptionHandler(self)
|
||||||
|
|
||||||
def unhandled_exception(self, type, value, tb):
|
def unhandled_exception(self, exc_type, value, tb):
|
||||||
if type is KeyboardInterrupt:
|
if exc_type is KeyboardInterrupt:
|
||||||
return
|
return
|
||||||
import traceback
|
import traceback
|
||||||
try:
|
try:
|
||||||
@ -141,13 +141,13 @@ class MainWindow(QMainWindow):
|
|||||||
print_basic_debug_info(out=sio)
|
print_basic_debug_info(out=sio)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
traceback.print_exception(type, value, tb, file=sio)
|
traceback.print_exception(exc_type, value, tb, file=sio)
|
||||||
if getattr(value, 'locking_debug_msg', None):
|
if getattr(value, 'locking_debug_msg', None):
|
||||||
prints(value.locking_debug_msg, file=sio)
|
prints(value.locking_debug_msg, file=sio)
|
||||||
fe = sio.getvalue()
|
fe = sio.getvalue()
|
||||||
prints(fe, file=sys.stderr)
|
prints(fe, file=sys.stderr)
|
||||||
fe = force_unicode(fe)
|
fe = force_unicode(fe)
|
||||||
msg = '<b>%s</b>:'%type.__name__ + as_unicode(value)
|
msg = '<b>%s</b>:'%exc_type.__name__ + as_unicode(value)
|
||||||
error_dialog(self, _('Unhandled exception'), msg, det_msg=fe,
|
error_dialog(self, _('Unhandled exception'), msg, det_msg=fe,
|
||||||
show=True)
|
show=True)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user