We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a4859b commit a2bcfdbCopy full SHA for a2bcfdb
1 file changed
Objects/setobject.c
@@ -3040,7 +3040,7 @@ PySet_Add(PyObject *anyset, PyObject *key)
3040
// this can be done without a lock.
3041
// Since another key is added to the set, we must track the frozenset
3042
// if needed.
3043
- if (PyFrozenSet_CheckExact(anyset) && PyObject_GC_IsTracked(key) && !PyObject_GC_IsTracked(anyset)) {
+ if (PyFrozenSet_CheckExact(anyset) && !PyObject_GC_IsTracked(anyset) && PyObject_GC_IsTracked(key)) {
3044
_PyObject_GC_TRACK(anyset);
3045
}
3046
return set_add_key((PySetObject *)anyset, key);
0 commit comments