Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: django/django
...
head fork: django/django
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 3 commit comments
  • 1 contributor
Commits on Jun 14, 2012
@spookylukey spookylukey 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.
edee20f
@spookylukey spookylukey IfParser.next() method renamed to avoid confusion with iterator proto…
…col.
fd6a9d3
Showing with 4 additions and 4 deletions.
  1. +4 −4 django/template/smartif.py
View
8 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_token()
def translate_token(self, token):
try:
@@ -175,7 +175,7 @@ def translate_token(self, token):
else:
return op()
- def next(self):
+ def next_token(self):
if self.pos >= len(self.tokens):
return EndToken
else:
@@ -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_token()
left = t.nud(self)
while rbp < self.current_token.lbp:
t = self.current_token
- self.current_token = next(self)
+ self.current_token = self.next_token()
left = t.led(left, self)
return left

Showing you all comments on commits in this comparison.

@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? :-)

Something went wrong with that request. Please try again.