[Python-Dev] bpo-36829: Add sys.unraisablehook()

Nathaniel Smith njs at pobox.com
Wed May 15 22:44:38 EDT 2019

On Wed, May 15, 2019 at 6:25 PM Victor Stinner <vstinner at redhat.com> wrote:
> I proposed a different approach: add a new sys.unraisablehook hook
> which is called to handle an "unraisable exception". To handle them
> differently, replace the hook. For example, I wrote a custom hook to
> log these exceptions into a file (the output on the Python test suite
> is interesting!). It also becomes trivial to reimplement Thomas's idea
> (kill the process):

What happens if the hook raises an exception?


Nathaniel J. Smith -- https://vorpus.org

More information about the Python-Dev mailing list