diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-25 11:31:05 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-25 11:31:05 (GMT) |
commit | b09ec9b6184dc81050449c3173238f88ab6cd875 (patch) | |
tree | 5f21193e020d0fc126fdca9e7720bf12268e7064 /Lib | |
parent | 7ee79a282338e979a14d17209705a910f9965c0b (diff) | |
download | cpython-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.py | 8 |
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) |