Skip to content
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

gh-108082: C API: Add tests for PyErr_WriteUnraisable() #111455

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 29, 2023

Also document the behavior when called with NULL.


📚 Documentation preview 📚: https://cpython-previews--111455.org.readthedocs.build/

Also document the behavior when called with NULL.
Comment on lines +98 to +99
.. versionchanged:: 3.4
Print a traceback. Print only traceback if *obj* is ``NULL``.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +101 to +102
.. versionchanged:: 3.8
Use :func:`sys.unraisablehook`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 95 to 96
.. versionchanged:: 3.2
Accept ``NULL`` as argument.
Copy link
Member Author

@serhiy-storchaka serhiy-storchaka Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it was cosmetic change. It skipped " in <NULL>" if obj is NULL.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I just made a minor coding style suggestion.

Modules/_testcapi/exceptions.c Outdated Show resolved Hide resolved
@serhiy-storchaka
Copy link
Member Author

Thank you Victor for your review.

@serhiy-storchaka serhiy-storchaka merged commit bca3305 into python:main Oct 30, 2023
25 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the test-capi-PyErr_WriteUnraisable branch October 30, 2023 17:01
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 30, 2023
…GH-111455)

Also document the behavior when called with NULL.
(cherry picked from commit bca3305)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 30, 2023

GH-111507 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 30, 2023
serhiy-storchaka added a commit that referenced this pull request Oct 30, 2023
…1455) (GH-111507)

Also document the behavior when called with NULL.
(cherry picked from commit bca3305)

Co-authored-by: Serhiy Storchaka <[email protected]>
FullteaR pushed a commit to FullteaR/cpython that referenced this pull request Nov 3, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants