Skip to content

[3.7] bpo-36829: Enhance PyErr_WriteUnraisable() #13487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2019
Merged

[3.7] bpo-36829: Enhance PyErr_WriteUnraisable() #13487

merged 1 commit into from
May 22, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 22, 2019

PyErr_WriteUnraisable() now displays the exception even if displaying
the traceback failed. Moreover, hold a 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.

https://bugs.python.org/issue36829

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.
@vstinner vstinner merged commit a58db96 into python:3.7 May 22, 2019
@vstinner vstinner deleted the unraisable37 branch May 22, 2019 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants