[issue1230540] sys.excepthook doesn't work in threads
STINNER Victor
report at bugs.python.org
Fri May 24 20:30:51 EDT 2019
STINNER Victor <vstinner at redhat.com> added the comment:
If you want to reuse sys.excepthook to handle uncaught Thread.run() exception, you can now write:
---
def hook(args):
if args.exc_type == SystemExit:
return
sys.excepthook(args.exc_type, args.exc_value, args.exc_traceback)
threading.excepthook = hook
---
Try attached sys_threading_excepthook.py for a full example.
----------
Added file: https://bugs.python.org/file48354/sys_threading_excepthook.py
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue1230540>
_______________________________________
More information about the Python-bugs-list
mailing list