summaryrefslogtreecommitdiff
path: root/django/template/smartif.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2012-06-14 23:04:30 +0100
committerLuke Plant <L.Plant.98@cantab.net>2012-06-14 23:12:15 +0100
commitedee20ff506779b7a7d4e10321a0a619ce0eb03d (patch)
tree6feb7805b64c0bc70bc7d0587132227d9ac5d3f3 /django/template/smartif.py
parent023b70415b689f18115b7bf3842ed6d57c90fa8d (diff)
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.
Diffstat (limited to 'django/template/smartif.py')
-rw-r--r--django/template/smartif.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/smartif.py b/django/template/smartif.py
index 272eab1e91..54d74b4e25 100644
--- a/django/template/smartif.py
+++ b/django/template/smartif.py
@@ -165,7 +165,7 @@ class IfParser(object):
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 @@ class IfParser(object):
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