chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c71d5e
)
symm/multigen: Fix for Python 2.5.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 28 Dec 2013 13:59:44 +0000
(13:59 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 28 Dec 2013 13:59:44 +0000
(13:59 +0000)
The top-level `next' function was introduced in 2.6, so use `.next()'
and catch `StopIteration'.
symm/multigen
patch
|
blob
|
blame
|
history
diff --git
a/symm/multigen
b/symm/multigen
index 2d626c22ba6441ec3f6286fd197672f018724402..d532cda7d2b0e6307da9d2288cbf70bbfcaee9a7 100755
(executable)
--- a/
symm/multigen
+++ b/
symm/multigen
@@
-218,8
+218,9
@@
class ParseState (object):
me._it = iter(text.splitlines(True))
me.step()
def step(me):
- me.curr = next(me._it, None)
- if me.curr is not None: me._i += 1
+ try: me.curr = me._it.next()
+ except StopIteration: me.curr = None
+ else: me._i += 1
def error(me, msg):
die('%s:%d: %s' % (me._file, me._i, msg))