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.
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 63fb831..93224e1 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1857,6 +1857,11 @@
unicode_encodedecimal(u"123" + s, "xmlcharrefreplace"),
'123' + exp)
+ def test_free_after_iterating(self):
+ test_support.check_free_after_iterating(self, iter, unicode)
+ test_support.check_free_after_iterating(self, reversed, unicode)
+
+
def test_main():
test_support.run_unittest(__name__)