summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2011-10-30 12:31:27 (GMT)
committerPetri Lehtinen <petri@digip.org>2011-10-30 12:35:12 (GMT)
commite0aa8037149c24f9fe8c37c2e129eb904723a3a6 (patch)
tree11891ecc5917cc3d4f4b01df87b22fcf896bd1d9 /Objects
parent5acc27ebe442306c667ddd2422afee2c38d2e1aa (diff)
downloadcpython-e0aa8037149c24f9fe8c37c2e129eb904723a3a6.zip
cpython-e0aa8037149c24f9fe8c37c2e129eb904723a3a6.tar.gz
cpython-e0aa8037149c24f9fe8c37c2e129eb904723a3a6.tar.bz2
Fix the return value of set_discard (issue #10519)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 9f39fcb..69eb889 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1942,9 +1942,10 @@ set_discard(PySetObject *so, PyObject *key)
tmpkey = make_new_set(&PyFrozenSet_Type, key);
if (tmpkey == NULL)
return NULL;
- result = set_discard_key(so, tmpkey);
+ rv = set_discard_key(so, tmpkey);
Py_DECREF(tmpkey);
- return result;
+ if (rv == -1)
+ return NULL;
}
Py_RETURN_NONE;
}