diff options
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r-- | Objects/exceptions.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 85cf2cca165..42c5317d83d 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -208,7 +208,7 @@ BaseException_add_note(PyObject *self, PyObject *note) } PyObject *notes; - if (_PyObject_LookupAttr(self, &_Py_ID(__notes__), ¬es) < 0) { + if (PyObject_GetOptionalAttr(self, &_Py_ID(__notes__), ¬es) < 0) { return NULL; } if (notes == NULL) { @@ -941,7 +941,7 @@ exceptiongroup_subset( PyException_SetCause(eg, PyException_GetCause(orig)); PyObject *notes; - if (_PyObject_LookupAttr(orig, &_Py_ID(__notes__), ¬es) < 0) { + if (PyObject_GetOptionalAttr(orig, &_Py_ID(__notes__), ¬es) < 0) { goto error; } if (notes) { |