Skip to content

Commit

Permalink
pythongh-125887: Update PyObject_HasAttr exception behavior (pythonGH…
Browse files Browse the repository at this point in the history
…-125907)

Update PyObject_HasAttr exception behavior

(cherry picked from commit 08a0728)

Co-authored-by: Damien <[email protected]>
Co-authored-by: Shantanu <[email protected]>
  • Loading branch information
2 people authored and miss-islington committed Dec 27, 2024
1 parent 1781525 commit 4d3bf50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/c-api/object.rst
Original 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

0 comments on commit 4d3bf50

Please sign in to comment.