Fixed python3 iterator protocol.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 29 Dec 2011 00:43:20 +0000 (01:43 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 29 Dec 2011 00:43:20 +0000 (01:43 +0100)
wrw/dispatch.py

index 50adc04..709cfe4 100644 (file)
@@ -20,17 +20,17 @@ class iterproxy(object):
         self.bk = real
         self.bki = iter(real)
         self._next = [None]
-        self.next()
+        self.__next__()
 
     def __iter__(self):
         return self
 
-    def next(self):
+    def __next__(self):
         if self._next is None:
             raise StopIteration()
         ret = self._next[0]
         try:
-            self._next[:] = [self.bki.next()]
+            self._next[:] = [self.bki.__next__()]
         except StopIteration:
             self._next = None
         return ret