symm/multigen: Fix for Python 2.5.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 28 Dec 2013 13:59:44 +0000 (13:59 +0000)
committerMark 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

index 2d626c2..d532cda 100755 (executable)
@@ -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))