Delete the iterator, which could accidentally keep a temporary reference to the yielded element.
This commit is contained in:
parent
9edceb3e59
commit
95a97b7c0c
|
@ -335,6 +335,7 @@ class TestWeakSet(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
it = iter(s)
|
it = iter(s)
|
||||||
next(it)
|
next(it)
|
||||||
|
del it
|
||||||
# Schedule an item for removal and recreate it
|
# Schedule an item for removal and recreate it
|
||||||
u = ustr(str(items.pop()))
|
u = ustr(str(items.pop()))
|
||||||
gc.collect() # just in case
|
gc.collect() # just in case
|
||||||
|
|
Loading…
Reference in New Issue