From: Petri Lehtinen Date: Sun, 30 Oct 2011 12:31:27 +0000 (+0200) Subject: Fix the return value of set_discard (issue #10519) X-Git-Tag: v3.3.0a1~993^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0aa8037149c24f9fe8c37c2e129eb904723a3a6;p=python Fix the return value of set_discard (issue #10519) --- diff --git a/Objects/setobject.c b/Objects/setobject.c index 9f39fcbadb..69eb88933d 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; }