summaryrefslogtreecommitdiffstats
path: root/Lib/_weakrefset.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-12-17 23:28:36 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-12-17 23:28:36 (GMT)
commit320b39158ebfd63f25eb5f10dd65792334445eda (patch)
treea2e8d0b7a9eaf211f55c489888780c4c7e163362 /Lib/_weakrefset.py
parent0c73fc04e603be95e8609523794ad7233764e986 (diff)
downloadcpython-320b39158ebfd63f25eb5f10dd65792334445eda.zip
cpython-320b39158ebfd63f25eb5f10dd65792334445eda.tar.gz
cpython-320b39158ebfd63f25eb5f10dd65792334445eda.tar.bz2
Issue #20006: Fix sporadic failures in test_weakset.
Diffstat (limited to 'Lib/_weakrefset.py')
-rw-r--r--Lib/_weakrefset.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py
index 6a98b88..7f9923c 100644
--- a/Lib/_weakrefset.py
+++ b/Lib/_weakrefset.py
@@ -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):