diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 17:40:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-03-30 17:40:02 (GMT) |
commit | fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa (patch) | |
tree | 4ae6657a598c5cfe5357f3106d956ed721d83e24 /Lib/test/seq_tests.py | |
parent | 13b3acd13e35b5e619c3d1aab90aaf54abc1fb53 (diff) | |
download | cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.zip cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.tar.gz cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.tar.bz2 |
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/seq_tests.py')
-rw-r--r-- | Lib/test/seq_tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py index 2416249..72f4845 100644 --- a/Lib/test/seq_tests.py +++ b/Lib/test/seq_tests.py @@ -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) |