Author: Richard Plangger <[email protected]>
Branch: py3.5
Changeset: r87661:569b72af42d9
Date: 2016-10-09 13:16 +0200
http://bitbucket.org/pypy/pypy/changeset/569b72af42d9/

Log:    skip the tests, adding the method to the __setstate__ slot works,
        but pickling will never use that method. removed and test is skipped
        to not create confusion

diff --git a/lib-python/3/test/test_iter.py b/lib-python/3/test/test_iter.py
--- a/lib-python/3/test/test_iter.py
+++ b/lib-python/3/test/test_iter.py
@@ -938,6 +938,7 @@
         with self.assertRaises(OverflowError):
             next(it)
 
+    @cpython_only
     def test_iter_neg_setstate(self):
         it = iter(UnlimitedSequenceClass())
         it.__setstate__(-42)
diff --git a/pypy/objspace/std/iterobject.py b/pypy/objspace/std/iterobject.py
--- a/pypy/objspace/std/iterobject.py
+++ b/pypy/objspace/std/iterobject.py
@@ -40,15 +40,6 @@
     def descr_length_hint(self, space):
         return self.getlength(space)
 
-    def descr_setstate(self, space, w_state):
-        index = space.int_w(w_state)
-        if self.w_seq is not space.w_None:
-            if index < 0:
-                index = 0
-
-            self.index = index
-
-
 W_AbstractSeqIterObject.typedef = TypeDef(
     "sequenceiterator",
     __doc__ = '''iter(collection) -> iterator
@@ -61,7 +52,6 @@
     __next__ = interpindirect2app(W_AbstractSeqIterObject.descr_next),
     __reduce__ = interp2app(W_AbstractSeqIterObject.descr_reduce),
     __length_hint__ = interp2app(W_AbstractSeqIterObject.descr_length_hint),
-    __setstate__ = interp2app(W_AbstractSeqIterObject.descr_setstate),
 )
 W_AbstractSeqIterObject.typedef.acceptable_as_base_class = False
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to