]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36829: Enhance PyErr_WriteUnraisable() (GH-13487)
authorVictor Stinner <vstinner@redhat.com>
Wed, 22 May 2019 16:23:28 +0000 (18:23 +0200)
committerGitHub <noreply@github.com>
Wed, 22 May 2019 16:23:28 +0000 (18:23 +0200)
commita58db9628d0c96cc5b863137fed4e432238f8027
treef47a49eb5b1d3f894bb118814857fe54fb5d975b
parentd092caf096fa48baadfc0900792206bb5aa0192d
bpo-36829: Enhance PyErr_WriteUnraisable() (GH-13487)

PyErr_WriteUnraisable() now displays the exception even if displaying
the traceback failed. Moreover, hold a strong reference to sys.stderr
while using it.

Document that an exception must be set when calling
PyErr_WriteUnraisable(), but don't add an assertion to check it at
runtime.

Cleanup: use longer names for variables and create
write_unraisable_exc_file() subfunction.
Doc/c-api/exceptions.rst
Misc/NEWS.d/next/Core and Builtins/2019-05-22-11-44-41.bpo-36829.ZmpHR9.rst [new file with mode: 0644]
Python/errors.c