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

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


http://hg.python.org/cpython/rev/7ddc7b339a8b
changeset:   73202:7ddc7b339a8b
branch:      2.7
parent:      73199:72de2ac8bb4f
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
@@ -1936,9 +1936,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