Commits

Anonymous committed f189da5

Delete the iterator, which could accidentally keep a temporary reference to the yielded element.

Comments (0)

Files changed (1)

Lib/test/test_weakset.py

             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