Author: Carl Friedrich Bolz-Tereick <cfb...@gmx.de> Branch: py3.7 Changeset: r98495:9d31a887ead7 Date: 2020-01-08 14:05 +0100 http://bitbucket.org/pypy/pypy/changeset/9d31a887ead7/
Log: merge py3.6 diff --git a/pypy/module/itertools/interp_itertools.py b/pypy/module/itertools/interp_itertools.py --- a/pypy/module/itertools/interp_itertools.py +++ b/pypy/module/itertools/interp_itertools.py @@ -1071,7 +1071,8 @@ w_newkey = w_newvalue else: w_newkey = space.call_function(groupby.w_keyfunc, w_newvalue) - assert groupby.w_currvalue is None + #assert groupby.w_currvalue is None + # ^^^ check disabled, see http://bugs.python.org/issue30347 groupby.w_currkey = w_newkey groupby.w_currvalue = w_newvalue 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 @@ -553,6 +553,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 diff --git a/pypy/tool/pytest/apptest2.py b/pypy/tool/pytest/apptest2.py --- a/pypy/tool/pytest/apptest2.py +++ b/pypy/tool/pytest/apptest2.py @@ -46,6 +46,7 @@ if not isinstance(w_obj, pypy.interpreter.function.Function): continue items.append(AppTestFunction(name, self, w_obj)) + items.sort(key=lambda item: item.reportinfo()[:2]) return items def setup(self): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit