summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:24:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:24:47 (GMT)
commit339e91d4cb5fcbd622447b5249c4570d35c577f9 (patch)
tree3410e985aef9c6cc94e4678b2b7f3b9372be97ff /Lib
parent5070c27a8f1ccc887c5cf60fd9993f0df3234f17 (diff)
parenta3e9128aba49b99451b19b49982b7b48e4f7ffe6 (diff)
downloadcpython-339e91d4cb5fcbd622447b5249c4570d35c577f9.zip
cpython-339e91d4cb5fcbd622447b5249c4570d35c577f9.tar.gz
cpython-339e91d4cb5fcbd622447b5249c4570d35c577f9.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')
-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 90e85a9..efd50ba 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())