diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 20:41:15 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 20:41:15 +0300 |
commit | ab479c49d31be03e85b824b8444b474b28e6db71 (patch) | |
tree | f171c7cb1f6e5568b7309665b0e87dae9dda67f5 /Lib/test/test_bytes.py | |
parent | fe4c01268cf9e94869a476495213fc362ef3a697 (diff) | |
parent | fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa (diff) | |
download | cpython-git-ab479c49d31be03e85b824b8444b474b28e6db71.tar.gz |
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.
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r-- | Lib/test/test_bytes.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 5d0351bbfe..90bcc42dbd 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -761,6 +761,10 @@ class BaseBytesTest: 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 |