X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fdispatch.py;h=709cfe4e18dedad2921de5e7390e4a601c313f29;hb=ca6fd155fd1cf58241c9d136977c2fd08948b51b;hp=fe62df33c4f75c3321aaea0cf039e810155ad816;hpb=e8aa9ce29141768796b430fa8c6f95dce6e7a507;p=wrw.git diff --git a/wrw/dispatch.py b/wrw/dispatch.py index fe62df3..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 @@ -46,7 +46,7 @@ def handle(req, startreq, handler): try: resp = iterproxy(handler(req)) break - except restart, i: + except restart as i: handler = i.handle req.commit(startreq) return resp