mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
This commit is contained in:
parent
13b3acd13e
commit
fbb1c5ee06
19 changed files with 94 additions and 24 deletions
|
@ -5,6 +5,7 @@ Tests common to tuple, list and UserList.UserList
|
|||
import unittest
|
||||
import sys
|
||||
import pickle
|
||||
from test import support
|
||||
|
||||
# Various iterables
|
||||
# This is used for checking the constructor (here and in test_deque.py)
|
||||
|
@ -408,3 +409,7 @@ class CommonTest(unittest.TestCase):
|
|||
lst2 = pickle.loads(pickle.dumps(lst, proto))
|
||||
self.assertEqual(lst2, lst)
|
||||
self.assertNotEqual(id(lst2), id(lst))
|
||||
|
||||
def test_free_after_iterating(self):
|
||||
support.check_free_after_iterating(self, iter, self.type2test)
|
||||
support.check_free_after_iterating(self, reversed, self.type2test)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue