Skip to content

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

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:test-capi-PyErr_WriteUnraisable
Oct 30, 2023
Merged

gh-108082: C API: Add tests for PyErr_WriteUnraisable()#111455
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:test-capi-PyErr_WriteUnraisable

Conversation

@serhiy-storchaka

@serhiy-storchakaserhiy-storchaka commented Oct 29, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Comment threadDoc/c-api/exceptions.rst Outdated
Comment on lines +95 to +96
.. versionchanged:: 3.2
Accept ``NULL`` as argument.

@serhiy-storchakaserhiy-storchakaOct 29, 2023

Copy link
Copy Markdown
MemberAuthor

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.

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

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.

Comment threadModules/_testcapi/exceptions.c Outdated
Co-authored-by: Victor Stinner <vstinner@python.org>
@serhiy-storchaka

Copy link
Copy Markdown
MemberAuthor

Thank you Victor for your review.

@serhiy-storchaka
serhiy-storchaka merged commit bca3305 into python:mainOct 30, 2023
@miss-islington-app

Copy link
Copy Markdown

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 <storchaka@gmail.com>
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.12 only 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 <storchaka@gmail.com>
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@vstinner