Skip to content

Commit

Permalink
Fix the return value of set_discard (issue python#10519)
Browse files Browse the repository at this point in the history
  • Loading branch information
akheron committed Oct 30, 2011
1 parent 5acc27e commit e0aa803
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e0aa803

Please sign in to comment.