Author: Armin Rigo <ar...@tunes.org> Branch: py3.5 Changeset: r92436:db294f23903a Date: 2017-09-22 14:56 +0200 http://bitbucket.org/pypy/pypy/changeset/db294f23903a/
Log: Test and fix for CPython's test_itertools (broken by accident in 17c8c1d27c41) 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 @@ -445,6 +445,7 @@ __iter__ = interp2app(W_ISlice.iter_w), __next__ = interp2app(W_ISlice.next_w), __reduce__ = interp2app(W_ISlice.descr_reduce), + __setstate__ = interp2app(W_ISlice.descr_setstate), __doc__ = """Make an iterator that returns selected elements from the iterable. If start is non-zero, then elements from the iterable are skipped until start is reached. Afterward, elements are 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 @@ -1028,6 +1028,8 @@ assert list(itertools.islice(c2, 3)) == expected c3 = pickle.loads(pickle.dumps(c)) assert list(itertools.islice(c3, 3)) == expected + c4 = copy.copy(itertools.islice([1, 2, 3], 1, 5)) + assert list(c4) == [2, 3] def test_islice_attack(self): import itertools _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit