diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-25 11:26:55 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-25 11:26:55 (GMT) |
commit | c5dadcf2fd0fb1a22ee6e1024fd1709e85d6a2f8 (patch) | |
tree | b1c7bd97abb234185900c4f394345f9738f1c9a4 /Lib/test/test_itertools.py | |
parent | a8e6af6ac35885103d0dbf6a8a4ffd682308eb2f (diff) | |
parent | 339e91d4cb5fcbd622447b5249c4570d35c577f9 (diff) | |
download | cpython-c5dadcf2fd0fb1a22ee6e1024fd1709e85d6a2f8.zip cpython-c5dadcf2fd0fb1a22ee6e1024fd1709e85d6a2f8.tar.gz cpython-c5dadcf2fd0fb1a22ee6e1024fd1709e85d6a2f8.tar.bz2 |
Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r-- | Lib/test/test_itertools.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index ece7f99..835ae33 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -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()) |