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 58a1f87..3cddf40 100644
--- 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