mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
merge
This commit is contained in:
commit
7a1a0bbbf1
3 changed files with 10 additions and 0 deletions
|
@ -289,6 +289,11 @@ class TestBasic(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
self.assertEqual(d.index(element, start, stop), target)
|
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):
|
def test_insert(self):
|
||||||
# Test to make sure insert behaves like lists
|
# Test to make sure insert behaves like lists
|
||||||
elements = 'ABCDEFGHI'
|
elements = 'ABCDEFGHI'
|
||||||
|
|
|
@ -83,6 +83,9 @@ Library
|
||||||
header in part headers. Patch written by Peter Landry and reviewed by Pierre
|
header in part headers. Patch written by Peter Landry and reviewed by Pierre
|
||||||
Quentel.
|
Quentel.
|
||||||
|
|
||||||
|
- Issue #24913: Fix overrun error in deque.index().
|
||||||
|
Found by John Leitch and Bryce Darling.
|
||||||
|
|
||||||
- Issue #24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
|
- Issue #24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
|
||||||
|
|
||||||
- Issue #21159: Improve message in configparser.InterpolationMissingOptionError.
|
- Issue #21159: Improve message in configparser.InterpolationMissingOptionError.
|
||||||
|
|
|
@ -924,6 +924,8 @@ deque_index(dequeobject *deque, PyObject *args)
|
||||||
if (stop < 0)
|
if (stop < 0)
|
||||||
stop = 0;
|
stop = 0;
|
||||||
}
|
}
|
||||||
|
if (stop > Py_SIZE(deque))
|
||||||
|
stop = Py_SIZE(deque);
|
||||||
|
|
||||||
for (i=0 ; i<stop ; i++) {
|
for (i=0 ; i<stop ; i++) {
|
||||||
if (i >= start) {
|
if (i >= start) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue