Skip to content

Commit

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

Co-authored-by: Shantanu <[email protected]>
  • Loading branch information
Damien-Chen and hauntsaninja authored Dec 27, 2024
1 parent 401bba6 commit 08a0728
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 08a0728

Please sign in to comment.