[pypy-commit] pypy default: Fix for the test in 7307034ccd39.

arigo noreply at buildbot.pypy.org
Sat Sep 1 18:50:08 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r57071:b20a8c159d25
Date: 2012-09-01 18:49 +0200
http://bitbucket.org/pypy/pypy/changeset/b20a8c159d25/

Log:	Fix for the test in 7307034ccd39.

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
@@ -824,7 +824,8 @@
         tee_state = myiter.tee_state
         iterators_w = [w_iterable] * n
         for i in range(1, n):
-            iterators_w[i] = space.wrap(W_TeeIterable(space, tee_state))
+            iterators_w[i] = space.wrap(W_TeeIterable(space, tee_state,
+                                                      myiter.index))
     else:
         tee_state = TeeState(space, w_iterable)
         iterators_w = [space.wrap(W_TeeIterable(space, tee_state)) for x in range(n)]
@@ -847,10 +848,10 @@
             return self.saved_w[index]
 
 class W_TeeIterable(Wrappable):
-    def __init__(self, space, tee_state):
+    def __init__(self, space, tee_state, start_index=0):
         self.space = space
         self.tee_state = tee_state
-        self.index = 0
+        self.index = start_index
 
     def iter_w(self):
         return self.space.wrap(self)


More information about the pypy-commit mailing list