mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-120384: Fix array-out-of-bounds crash in list_ass_subscript
(#120442)
This commit is contained in:
parent
733dac01b0
commit
8334a1b55c
4 changed files with 58 additions and 12 deletions
|
@ -191,6 +191,14 @@ class CommonTest(seq_tests.CommonTest):
|
|||
|
||||
self.assertRaises(TypeError, a.__setitem__)
|
||||
|
||||
def test_slice_assign_iterator(self):
|
||||
x = self.type2test(range(5))
|
||||
x[0:3] = reversed(range(3))
|
||||
self.assertEqual(x, self.type2test([2, 1, 0, 3, 4]))
|
||||
|
||||
x[:] = reversed(range(3))
|
||||
self.assertEqual(x, self.type2test([2, 1, 0]))
|
||||
|
||||
def test_delslice(self):
|
||||
a = self.type2test([0, 1])
|
||||
del a[1:2]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue