From: Antoine Pitrou Date: Mon, 20 Feb 2012 23:00:06 +0000 (+0100) Subject: Delete the iterator, which could accidentally keep a temporary reference to the yield... X-Git-Tag: v3.2.3rc1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95a97b7c0cd52fafb9defaa1737d432a0eb1c95f;p=thirdparty%2FPython%2Fcpython.git Delete the iterator, which could accidentally keep a temporary reference to the yielded element. --- diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py index 58a1f8790ae2..3cddf40c248c 100644 --- a/Lib/test/test_weakset.py +++ b/Lib/test/test_weakset.py @@ -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