summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-02-20 23:00:06 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-02-20 23:00:06 (GMT)
commit95a97b7c0cd52fafb9defaa1737d432a0eb1c95f (patch)
tree11a861bf271e8bad0a1076fc0119ee2f740177dd /Lib
parent9edceb3e591063f382ae82e14313813ffc1af0bf (diff)
downloadcpython-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')
-rw-r--r--Lib/test/test_weakset.py1
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