Skip to content

Commit 08a0728

Browse files
gh-125887: Update PyObject_HasAttr exception behavior (#125907)
Update PyObject_HasAttr exception behavior Co-authored-by: Shantanu <[email protected]>
1 parent 401bba6 commit 08a0728

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/c-api/object.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Object Protocol
111111
.. note::
112112
113113
Exceptions that occur when this calls :meth:`~object.__getattr__` and
114-
:meth:`~object.__getattribute__` methods are silently ignored.
114+
:meth:`~object.__getattribute__` methods aren't propagated,
115+
but instead given to :func:`sys.unraisablehook`.
115116
For proper error handling, use :c:func:`PyObject_HasAttrWithError`,
116117
:c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead.
117118

0 commit comments

Comments
 (0)