mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
|
@ -2729,6 +2729,10 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
# Check that the second call returns the same result
|
||||
self.assertEqual(getargs_s_hash(s), chr(k).encode() * (i + 1))
|
||||
|
||||
def test_free_after_iterating(self):
|
||||
support.check_free_after_iterating(self, iter, str)
|
||||
support.check_free_after_iterating(self, reversed, str)
|
||||
|
||||
|
||||
class StringModuleTest(unittest.TestCase):
|
||||
def test_formatter_parser(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue