[3.10] bpo-46615: Don't crash when set operations mutate the sets (GH-31120) by miss-islington · Pull Request #31284 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
186 changes: 186 additions & 0 deletions Lib/test/test_set.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When iterating over sets internally in ``setobject.c``, acquire strong references to the resulting items from the set. This prevents crashes in corner-cases of various set operations where the set gets mutated.
47 changes: 39 additions & 8 deletions Objects/setobject.c