commit | e0aa8037149c24f9fe8c37c2e129eb904723a3a6 | [log] [tgz] |
---|---|---|
author | Petri Lehtinen <petri@digip.org> | Sun Oct 30 14:31:27 2011 +0200 |
committer | Petri Lehtinen <petri@digip.org> | Sun Oct 30 14:35:12 2011 +0200 |
tree | 11891ecc5917cc3d4f4b01df87b22fcf896bd1d9 | |
parent | 5acc27ebe442306c667ddd2422afee2c38d2e1aa [diff] [blame] |
Fix the return value of set_discard (issue #10519)
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 @@ 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; }