mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 18:13:04 +02:00
Fix regression that broke the unhandled exception handler
This commit is contained in:
parent
880b3acc1d
commit
b68dbb2bf5
1 changed files with 4 additions and 3 deletions
|
|
@ -5,14 +5,14 @@
|
|||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
|
||||
import traceback, sys, gc, weakref
|
||||
import sys, gc, weakref
|
||||
from io import BytesIO
|
||||
|
||||
from PyQt5.Qt import (QMainWindow, QTimer, QAction, QMenu, QMenuBar, QIcon,
|
||||
QObject)
|
||||
from calibre.utils.config import OptionParser
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre import prints, force_unicode
|
||||
from calibre import prints, force_unicode, as_unicode
|
||||
|
||||
|
||||
def option_parser(usage='''\
|
||||
|
|
@ -133,6 +133,7 @@ def set_exception_handler(self):
|
|||
def unhandled_exception(self, type, value, tb):
|
||||
if type is KeyboardInterrupt:
|
||||
return
|
||||
import traceback
|
||||
try:
|
||||
sio = BytesIO()
|
||||
try:
|
||||
|
|
@ -146,7 +147,7 @@ def unhandled_exception(self, type, value, tb):
|
|||
fe = sio.getvalue()
|
||||
prints(fe, file=sys.stderr)
|
||||
fe = force_unicode(fe)
|
||||
msg = '<b>%s</b>:'%type.__name__ + force_unicode(value)
|
||||
msg = '<b>%s</b>:'%type.__name__ + as_unicode(value)
|
||||
error_dialog(self, _('Unhandled exception'), msg, det_msg=fe,
|
||||
show=True)
|
||||
except BaseException:
|
||||
|
|
|
|||
Loading…
Reference in a new issue