]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Delete the iterator, which could accidentally keep a temporary reference to the yield...
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 20 Feb 2012 23:00:06 +0000 (00:00 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 20 Feb 2012 23:00:06 +0000 (00:00 +0100)
Lib/test/test_weakset.py

index 58a1f8790ae23cc1b80cd12f43881cf22c9777d8..3cddf40c248cb97bc7c12068aecfd21ebe0e2d38 100644 (file)
@@ -335,6 +335,7 @@ class TestWeakSet(unittest.TestCase):
             try:
                 it = iter(s)
                 next(it)
+                del it
                 # Schedule an item for removal and recreate it
                 u = ustr(str(items.pop()))
                 gc.collect()      # just in case