]> granicus.if.org Git - python/commitdiff
Fix the return value of set_discard (issue #10519)
authorPetri Lehtinen <petri@digip.org>
Sun, 30 Oct 2011 12:31:27 +0000 (14:31 +0200)
committerPetri Lehtinen <petri@digip.org>
Sun, 30 Oct 2011 12:35:12 +0000 (14:35 +0200)
Objects/setobject.c

index 9f39fcbadbc4df391960b32153408713c15b9bb1..69eb88933de7b013026b82c856415437f87c0efa 100644 (file)
@@ -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;
 }