Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reverted part of 169b1a4 which was mistakenly applied to a non-iterat…

…or 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.
  • Loading branch information...
commit edee20ff506779b7a7d4e10321a0a619ce0eb03d 1 parent 023b704
@spookylukey spookylukey authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/template/smartif.py
View
6 django/template/smartif.py
@@ -165,7 +165,7 @@ def __init__(self, tokens):
self.tokens = mapped_tokens
self.pos = 0
- self.current_token = next(self)
+ self.current_token = self.next()
def translate_token(self, token):
try:
@@ -193,11 +193,11 @@ def parse(self):
def expression(self, rbp=0):
t = self.current_token
- self.current_token = next(self)
+ self.current_token = self.next()
left = t.nud(self)
while rbp < self.current_token.lbp:
t = self.current_token
- self.current_token = next(self)
+ self.current_token = self.next()
left = t.led(left, self)
return left

3 comments on commit edee20f

@claudep
Collaborator

Thanks Luke for fixing it and sorry for the confusion I made.

@spookylukey
Collaborator
@claudep
Collaborator

No, no, that's fine. That's collaborate work, isn't it? :-)

Please sign in to comment.
Something went wrong with that request. Please try again.