diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-20 23:00:06 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-20 23:00:06 (GMT) |
commit | 95a97b7c0cd52fafb9defaa1737d432a0eb1c95f (patch) | |
tree | 11a861bf271e8bad0a1076fc0119ee2f740177dd /Lib/test | |
parent | 9edceb3e591063f382ae82e14313813ffc1af0bf (diff) | |
download | cpython-95a97b7c0cd52fafb9defaa1737d432a0eb1c95f.zip cpython-95a97b7c0cd52fafb9defaa1737d432a0eb1c95f.tar.gz cpython-95a97b7c0cd52fafb9defaa1737d432a0eb1c95f.tar.bz2 |
Delete the iterator, which could accidentally keep a temporary reference to the yielded element.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_weakset.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py index 58a1f87..3cddf40 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 |