[pypy-commit] pypy default: test for the problem in e300fd927c59

cfbolz pypy.commits at gmail.com
Wed Jan 8 08:06:27 EST 2020


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: 
Changeset: r98492:4c97894c1026
Date: 2020-01-08 14:01 +0100
http://bitbucket.org/pypy/pypy/changeset/4c97894c1026/

Log:	test for the problem in e300fd927c59

diff --git a/pypy/module/itertools/test/test_itertools.py b/pypy/module/itertools/test/test_itertools.py
--- a/pypy/module/itertools/test/test_itertools.py
+++ b/pypy/module/itertools/test/test_itertools.py
@@ -645,6 +645,16 @@
         assert a == []
         assert b == [(True, 9)]
 
+    def test_groupby_crash(self):
+        # see http://bugs.python.org/issue30347
+        from itertools import groupby
+        def f(n):
+            if n == 5:
+                list(b)
+            return n != 6
+        for (k, b) in groupby(range(10), f):
+            list(b)  # shouldn't crash
+
     def test_iterables(self):
         import itertools
 


More information about the pypy-commit mailing list