[Python-Dev] bpo-36829: Add sys.unraisablehook() (original) (raw)
Nathaniel Smith njs at pobox.com
Thu May 16 15:29:00 EDT 2019
- Previous message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Next message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, May 16, 2019, 09:07 Steve Dower <steve.dower at python.org> wrote:
Actually, if the default implementation prints the exception message, how is this different from sys.excepthook? Specifically, from the point of customizing the hooks.
sys.excepthook means the program has fully unwound and is about to exit. This is pretty different from an exception inside a del or background thread or whatever, where the program definitely hasn't unwound and is likely to continue. And I'm pretty sure they have behavioral differences already, like if you pass in a SystemExit exception then sys.excepthook doesn't print anything, but PyErr_WriteUnraiseable prints a traceback.
So making them two separate hooks seems right to me. Some people will override both; that's fine.
-n -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20190516/059f443b/attachment-0001.html>
- Previous message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Next message (by thread): [Python-Dev] bpo-36829: Add sys.unraisablehook()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]