Skip to content

Commit bad6b7b

Browse files
miss-islingtonDamien-Chenhauntsaninja
authored
[3.13] gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) (#128283)
gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) Update PyObject_HasAttr exception behavior (cherry picked from commit 08a0728) Co-authored-by: Damien <[email protected]> Co-authored-by: Shantanu <[email protected]>
1 parent 1781525 commit bad6b7b

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)