summaryrefslogtreecommitdiff
path: root/paste
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-22 00:35:48 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-04-22 00:35:48 +0200
commit0e555786bdedb93c9ae687501aae8f0542df740f (patch)
tree9975c0e22116e51862c137c395f195e79bd271d2 /paste
parent61cc154316299d8e372722085baf110eb3a4833b (diff)
downloadpaste-0e555786bdedb93c9ae687501aae8f0542df740f.tar.gz
Port looper_iter to Python 3
Diffstat (limited to 'paste')
-rw-r--r--paste/util/looper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/paste/util/looper.py b/paste/util/looper.py
index dd0c6fd..0a846e5 100644
--- a/paste/util/looper.py
+++ b/paste/util/looper.py
@@ -7,7 +7,7 @@ These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context. Use like::
>>> for loop, item in looper(['a', 'b', 'c']):
- ... print(loop.number, item)
+ ... print("%s %s" % (loop.number, item))
... if not loop.last:
... print('---')
1 a
@@ -59,6 +59,7 @@ class looper_iter(object):
result = loop_pos(self.seq, self.pos), self.seq[self.pos]
self.pos += 1
return result
+ __next__ = next
class loop_pos(object):