summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:26:55 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:26:55 (GMT)
commitc5dadcf2fd0fb1a22ee6e1024fd1709e85d6a2f8 (patch)
treeb1c7bd97abb234185900c4f394345f9738f1c9a4 /Lib/test/test_itertools.py
parenta8e6af6ac35885103d0dbf6a8a4ffd682308eb2f (diff)
parent339e91d4cb5fcbd622447b5249c4570d35c577f9 (diff)
downloadcpython-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.py8
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())