diff options
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 8c3f0a1..900c374 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2203,11 +2203,10 @@ array_array___reduce_ex__(arrayobject *self, PyObject *value) if (protocol == -1 && PyErr_Occurred()) return NULL; - dict = _PyObject_GetAttrId((PyObject *)self, &PyId___dict__); + if (_PyObject_LookupAttrId((PyObject *)self, &PyId___dict__, &dict) < 0) { + return NULL; + } if (dict == NULL) { - if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - return NULL; - PyErr_Clear(); dict = Py_None; Py_INCREF(dict); } |