summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2015-09-03 17:15:03 (GMT)
committerBrett Cannon <brett@python.org>2015-09-03 17:15:03 (GMT)
commitdf6b544ff6f342e8a64056e627867a70413bfdb0 (patch)
treeba995c65afefd06ff9e890303d2fef6ed3fbe702 /Lib
parentb3d531348c40b195e6bb742d956ea749b3f7a969 (diff)
downloadcpython-df6b544ff6f342e8a64056e627867a70413bfdb0.zip
cpython-df6b544ff6f342e8a64056e627867a70413bfdb0.tar.gz
cpython-df6b544ff6f342e8a64056e627867a70413bfdb0.tar.bz2
Issue #24913: Fix overrun error in deque.index().
Reported by John Leitch and Bryce Darling, patch by Raymond Hettinger.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_deque.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index b858509..8718716 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -289,6 +289,11 @@ class TestBasic(unittest.TestCase):
else:
self.assertEqual(d.index(element, start, stop), target)
+ def test_insert_bug_24913(self):
+ d = deque('A' * 3)
+ with self.assertRaises(ValueError):
+ i = d.index("Hello world", 0, 4)
+
def test_insert(self):
# Test to make sure insert behaves like lists
elements = 'ABCDEFGHI'