summaryrefslogtreecommitdiffstats
path: root/Objects/setobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index fafc2fa..924885d 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1970,9 +1970,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);
}