mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Delete the iterator, which could accidentally keep a temporary reference to the yielded element.
This commit is contained in:
parent
9edceb3e59
commit
95a97b7c0c
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue