mirror of https://github.com/python/cpython
Frozensets do not benefit from autoconversion.
This commit is contained in:
parent
2e6407d813
commit
c5a1cc5c37
|
@ -1755,7 +1755,7 @@ set_contains(PySetObject *so, PyObject *key)
|
||||||
|
|
||||||
rv = set_contains_key(so, key);
|
rv = set_contains_key(so, key);
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
if (!PyAnySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
|
if (!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
|
||||||
return -1;
|
return -1;
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
|
tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
|
||||||
|
@ -1790,7 +1790,7 @@ set_remove(PySetObject *so, PyObject *key)
|
||||||
|
|
||||||
rv = set_discard_key(so, key);
|
rv = set_discard_key(so, key);
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
if (!PyAnySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
|
if (!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
|
||||||
return NULL;
|
return NULL;
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
|
tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
|
||||||
|
@ -1821,7 +1821,7 @@ set_discard(PySetObject *so, PyObject *key)
|
||||||
|
|
||||||
rv = set_discard_key(so, key);
|
rv = set_discard_key(so, key);
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
if (!PyAnySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
|
if (!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))
|
||||||
return NULL;
|
return NULL;
|
||||||
PyErr_Clear();
|
PyErr_Clear();
|
||||||
tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
|
tmpkey = make_new_set(&PyFrozenSet_Type, NULL);
|
||||||
|
|
Loading…
Reference in New Issue