mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-128961: Fix exhausted array iterator crash in __setstate__() (#128962)
This commit is contained in:
parent
9ed7bf2cd7
commit
4dade055f4
3 changed files with 19 additions and 5 deletions
|
@ -1665,5 +1665,13 @@ class LargeArrayTest(unittest.TestCase):
|
|||
self.assertEqual(ls[:8], list(example[:8]))
|
||||
self.assertEqual(ls[-8:], list(example[-8:]))
|
||||
|
||||
def test_gh_128961(self):
|
||||
a = array.array('i')
|
||||
it = iter(a)
|
||||
list(it)
|
||||
it.__setstate__(0)
|
||||
self.assertRaises(StopIteration, next, it)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue