Merge pull request #325 from MHordecki/format_exception

Use traceback.format_exception for debug error display.
This commit is contained in:
Damien Elmes 2019-08-20 19:35:54 +10:00 committed by GitHub
commit b0bf0adacf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,9 +12,8 @@ from aqt import mw
if not os.environ.get("DEBUG"):
def excepthook(etype,val,tb):
sys.stderr.write("Caught exception:\n%s%s\n" % (
''.join(traceback.format_tb(tb)),
'{0}: {1}'.format(etype, val)))
sys.stderr.write("Caught exception:\n%s\n" % (
''.join(traceback.format_exception(etype, val, tb))))
sys.excepthook = excepthook
class ErrorHandler(QObject):