Issue #20006: Fix sporadic failures in test_weakset.

This commit is contained in:
Antoine Pitrou 2013-12-18 00:28:36 +01:00
parent 0c73fc04e6
commit 320b39158e
2 changed files with 8 additions and 1 deletions

View file

@ -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):