gh-112087: Make list_{slice, ass_slice, subscript} to be threadsafe (gh-116233)

This commit is contained in:
Donghee Na 2024-03-05 13:58:14 +09:00 committed by GitHub
parent 58c7919d05
commit 6cddc731fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 87 additions and 50 deletions

View file

@ -96,6 +96,11 @@ class ListTest(list_tests.CommonTest):
self.assertRaises((MemoryError, OverflowError), mul, lst, n)
self.assertRaises((MemoryError, OverflowError), imul, lst, n)
def test_empty_slice(self):
x = []
x[:] = x
self.assertEqual(x, [])
def test_list_resize_overflow(self):
# gh-97616: test new_allocated * sizeof(PyObject*) overflow
# check in list_resize()