]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) (#128283)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 27 Dec 2024 02:03:38 +0000 (03:03 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Dec 2024 02:03:38 +0000 (02:03 +0000)
gh-125887: Update PyObject_HasAttr exception behavior (GH-125907)

Update PyObject_HasAttr exception behavior

(cherry picked from commit 08a0728d6c32986d35edb26872b4512a71ae60f3)

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

index 3f0fd905da509708a2ade7aed9b90617c8f5a9ae..ce6cb0496139f7f7769176655b37b620227cbb88 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.