gh-120384: Fix array-out-of-bounds crash in list_ass_subscript (#120442)

This commit is contained in:
Nikita Sobolev 2024-06-21 13:48:38 +03:00 committed by GitHub
parent 733dac01b0
commit 8334a1b55c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 58 additions and 12 deletions

View file

@ -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]