Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the condition
  • Loading branch information
yoney committed Oct 23, 2025
commit 68ecfe52617d8ff43d46e8b84e9b82fda85b8c1e
2 changes: 1 addition & 1 deletion Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2781,7 +2781,7 @@ PySet_Add(PyObject *anyset, PyObject *key)
return rv;
}

if (PyFrozenSet_Check(anyset) || _PyObject_IsUniquelyReferenced(anyset)) {
if (PyFrozenSet_Check(anyset) && _PyObject_IsUniquelyReferenced(anyset)) {
// We can only change frozensets if they are uniquely referenced. The
// API limits the usage of `PySet_Add` to "fill in the values of brand
// new frozensets before they are exposed to other code". In this case,
Expand Down
Loading