mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
This commit is contained in:
commit
c5dadcf2fd
3 changed files with 31 additions and 1 deletions
|
@ -1267,6 +1267,14 @@ class TestBasicOps(unittest.TestCase):
|
|||
self.pickletest(a, compare=ans)
|
||||
self.pickletest(b, compare=ans)
|
||||
|
||||
# Issue 13454: Crash when deleting backward iterator from tee()
|
||||
def test_tee_del_backward(self):
|
||||
forward, backward = tee(range(20000000))
|
||||
for i in forward:
|
||||
pass
|
||||
|
||||
del backward
|
||||
|
||||
def test_StopIteration(self):
|
||||
self.assertRaises(StopIteration, next, zip())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue