Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d13a1a5
)
Fixed python3 iterator protocol.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 29 Dec 2011 00:43:20 +0000
(
01:43
+0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 29 Dec 2011 00:43:20 +0000
(
01:43
+0100)
wrw/dispatch.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/dispatch.py
b/wrw/dispatch.py
index
50adc04
..
709cfe4
100644
(file)
--- 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