mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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:
parent
2f2dd992a3
commit
a3e9128aba
3 changed files with 31 additions and 1 deletions
|
@ -930,6 +930,14 @@ class TestBasicOps(unittest.TestCase):
|
|||
del a
|
||||
self.assertRaises(ReferenceError, getattr, p, '__class__')
|
||||
|
||||
# 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