8000 Update PyObject_HasAttr exception behavior · python/cpython@c82fc4b · GitHub
[go: up one dir, main page]

Skip to content

Commit c82fc4b

Browse files
committed
Update PyObject_HasAttr exception behavior
1 parent d3be6f9 commit c82fc4b

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)
0