[Python-checkins] cpython (3.2): Fix the return value of set_discard (issue #10519)

petri.lehtinen python-checkins at python.org
Sun Oct 30 13:38:34 CET 2011


http://hg.python.org/cpython/rev/b643458a0108
changeset:   73203:b643458a0108
branch:      3.2
parent:      73200:664bf4f3a820
user:        Petri Lehtinen <petri at digip.org>
date:        Sun Oct 30 14:31:27 2011 +0200
summary:
  Fix the return value of set_discard (issue #10519)

files:
  Objects/setobject.c |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1942,9 +1942,10 @@
         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;
 }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list