[Python-checkins] cpython (3.2): Delete the iterator, which could accidentally keep a temporary reference to the

antoine.pitrou python-checkins at python.org
Tue Feb 21 00:03:43 CET 2012


http://hg.python.org/cpython/rev/f189da5bda26
changeset:   75095:f189da5bda26
branch:      3.2
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Tue Feb 21 00:00:06 2012 +0100
summary:
  Delete the iterator, which could accidentally keep a temporary reference to the yielded element.

files:
  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
--- a/Lib/test/test_weakset.py
+++ b/Lib/test/test_weakset.py
@@ -335,6 +335,7 @@
             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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list