]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-125887: Update PyObject_HasAttr exception behavior (#125907)
authorDamien <81557462+Damien-Chen@users.noreply.github.com>
Fri, 27 Dec 2024 01:57:55 +0000 (09:57 +0800)
committerGitHub <noreply@github.com>
Fri, 27 Dec 2024 01:57:55 +0000 (17:57 -0800)
Update PyObject_HasAttr exception behavior

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Doc/c-api/object.rst

index f97ade01e67850b630de8fd93a22fd1817a5bdf1..a137688fe0754597572ad7c040dc1f9e3ecb3db2 100644 (file)
@@ -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.