Author: Carl Friedrich Bolz-Tereick <[email protected]>
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
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to