The top-level `next' function was introduced in 2.6, so use `.next()'
and catch `StopIteration'.
me._it = iter(text.splitlines(True))
me.step()
def step(me):
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))
def error(me, msg):
die('%s:%d: %s' % (me._file, me._i, msg))