8000 [3.13] gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) by miss-islington · Pull Request #128283 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.13] gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) #128283

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
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-125887: Update PyObject_HasAttr exception behavior (GH-125907)
Update PyObject_HasAttr exception behavior

(cherry picked from commit 08a0728)

Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
  • Loading branch information
2 people authored and miss-islington committed Dec 27, 2024
commit 4d3bf500d81e2bb6e5e09155d4e17f90700d5f52
3 changes: 2 additions & 1 deletion Doc/c-api/object.rst
O 6A4D riginal file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ Object Protocol
.. note::

Exceptions that occur when this calls :meth:`~object.__getattr__` and
:meth:`~object.__getattribute__` methods are silently ignored.
:meth:`~object.__getattribute__` methods aren't propagated,
but instead given to :func:`sys.unraisablehook`.
For proper error handling, use :c:func:`PyObject_HasAttrWithError`,
:c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead.

Expand Down
Loading
0