diff options
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r-- | Objects/setobject.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c index 8cd95ba890..f8ae0c05e2 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1954,9 +1954,10 @@ set_reduce(PySetObject *so, PyObject *Py_UNUSED(ignored)) args = PyTuple_Pack(1, keys); if (args == NULL) goto done; - dict = _PyObject_GetAttrId((PyObject *)so, &PyId___dict__); + if (_PyObject_LookupAttrId((PyObject *)so, &PyId___dict__, &dict) < 0) { + goto done; + } if (dict == NULL) { - PyErr_Clear(); dict = Py_None; Py_INCREF(dict); } |