summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:19:31 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:19:31 (GMT)
commita3e9128aba49b99451b19b49982b7b48e4f7ffe6 (patch)
tree768d8e543f44a9747172e84fe97094a42cf6bb0f /Lib
parent2f2dd992a3b73ee320834916e678be7762c06383 (diff)
downloadcpython-a3e9128aba49b99451b19b49982b7b48e4f7ffe6.zip
cpython-a3e9128aba49b99451b19b49982b7b48e4f7ffe6.tar.gz
cpython-a3e9128aba49b99451b19b49982b7b48e4f7ffe6.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 8cdc597..66e307d 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -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())