Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Luke Plant authored June 14, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/template/smartif.py
6  django/template/smartif.py
@@ -165,7 +165,7 @@ def __init__(self, tokens):
165 165
 
166 166
         self.tokens = mapped_tokens
167 167
         self.pos = 0
168  
-        self.current_token = next(self)
  168
+        self.current_token = self.next()
169 169
 
170 170
     def translate_token(self, token):
171 171
         try:
@@ -193,11 +193,11 @@ def parse(self):
193 193
 
194 194
     def expression(self, rbp=0):
195 195
         t = self.current_token
196  
-        self.current_token = next(self)
  196
+        self.current_token = self.next()
197 197
         left = t.nud(self)
198 198
         while rbp < self.current_token.lbp:
199 199
             t = self.current_token
200  
-            self.current_token = next(self)
  200
+            self.current_token = self.next()
201 201
             left = t.led(left, self)
202 202
         return left
203 203
 

3 notes on commit edee20f

Claude Paroz
Owner

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

Luke Plant
Owner
Claude Paroz
Owner

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.