summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:31:05 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 11:31:05 (GMT)
commitb09ec9b6184dc81050449c3173238f88ab6cd875 (patch)
tree5f21193e020d0fc126fdca9e7720bf12268e7064 /Lib
parent7ee79a282338e979a14d17209705a910f9965c0b (diff)
downloadcpython-b09ec9b6184dc81050449c3173238f88ab6cd875.zip
cpython-b09ec9b6184dc81050449c3173238f88ab6cd875.tar.gz
cpython-b09ec9b6184dc81050449c3173238f88ab6cd875.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 ccdbf8a..6f933c5 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -906,6 +906,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(xrange(20000000))
+ for i in forward:
+ pass
+
+ del backward
+
def test_StopIteration(self):
self.assertRaises(StopIteration, izip().next)