mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #20006: Fix sporadic failures in test_weakset.
This commit is contained in:
parent
0c73fc04e6
commit
320b39158e
2 changed files with 8 additions and 1 deletions
|
@ -60,6 +60,8 @@ class WeakSet:
|
|||
for itemref in self.data:
|
||||
item = itemref()
|
||||
if item is not None:
|
||||
# Caveat: the iterator will keep a strong reference to
|
||||
# `item` until it is resumed or closed.
|
||||
yield item
|
||||
|
||||
def __len__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue