diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 17:43:06 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 17:43:06 (GMT) |
commit | 14a7d6389fb453cca18d61bbe39deff7062bc66f (patch) | |
tree | d7e472d6fd44d7648ec2fd04dff7dd2c6ae7e393 /Lib/test/test_bytes.py | |
parent | d524b705afd09bad3d097cb413eff342dd5a5982 (diff) | |
download | cpython-14a7d6389fb453cca18d61bbe39deff7062bc66f.zip cpython-14a7d6389fb453cca18d61bbe39deff7062bc66f.tar.gz cpython-14a7d6389fb453cca18d61bbe39deff7062bc66f.tar.bz2 |
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of bytearray,
list, tuple, set, frozenset, dict, OrderedDict and corresponding views.
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 02fba38..82ad451 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -518,6 +518,10 @@ class BaseBytesTest(unittest.TestCase): self.assertRaisesRegexp(TypeError, r'\bendswith\b', b.endswith, x, None, None, None) + def test_free_after_iterating(self): + test.test_support.check_free_after_iterating(self, iter, self.type2test) + test.test_support.check_free_after_iterating(self, reversed, self.type2test) + class ByteArrayTest(BaseBytesTest): type2test = bytearray |