Reverted part of 169b1a40 which was mistakenly applied to a non-iterator class.

Doing next(IfParser()) works for Python 2.7, because it calls
IfParser.next(), but in Python 3 will call IfParser.__next__() which does
not work since it is not an iterator and does not have that method.
This commit is contained in:
Luke Plant 2012-06-14 23:04:30 +01:00
parent 023b70415b
commit edee20ff50
1 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ class IfParser(object):
self.tokens = mapped_tokens self.tokens = mapped_tokens
self.pos = 0 self.pos = 0
self.current_token = next(self) self.current_token = self.next()
def translate_token(self, token): def translate_token(self, token):
try: try:
@ -193,11 +193,11 @@ class IfParser(object):
def expression(self, rbp=0): def expression(self, rbp=0):
t = self.current_token t = self.current_token
self.current_token = next(self) self.current_token = self.next()
left = t.nud(self) left = t.nud(self)
while rbp < self.current_token.lbp: while rbp < self.current_token.lbp:
t = self.current_token t = self.current_token
self.current_token = next(self) self.current_token = self.next()
left = t.led(left, self) left = t.led(left, self)
return left return left