mirror of
https://github.com/python/cpython.git
synced 2025-10-28 04:04: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
|
|
@ -747,6 +747,10 @@ def test_find_etc_raise_correct_error_messages(self):
|
|||
self.assertRaisesRegex(TypeError, r'\bendswith\b', b.endswith,
|
||||
x, None, None, None)
|
||||
|
||||
def test_free_after_iterating(self):
|
||||
test.support.check_free_after_iterating(self, iter, self.type2test)
|
||||
test.support.check_free_after_iterating(self, reversed, self.type2test)
|
||||
|
||||
|
||||
class BytesTest(BaseBytesTest, unittest.TestCase):
|
||||
type2test = bytes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue