From: Fredrik Tolf Date: Thu, 29 Dec 2011 00:43:20 +0000 (+0100) Subject: Fixed python3 iterator protocol. X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=6cf09c7658532e0bdaa1eeb5414a3de129bd0b40 Fixed python3 iterator protocol. --- diff --git a/wrw/dispatch.py b/wrw/dispatch.py index 50adc04..709cfe4 100644 --- a/wrw/dispatch.py +++ b/wrw/dispatch.py @@ -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