mirror of
https://github.com/django/django.git
synced 2025-10-30 09:06:13 +00:00
Replaced foo.next() by next(foo).
This new syntax for next() has been introduced in Python 2.6 and is compatible with Python 3.
This commit is contained in:
@@ -173,7 +173,7 @@ class Token(object):
|
||||
sentinal = bit[2] + ')'
|
||||
trans_bit = [bit]
|
||||
while not bit.endswith(sentinal):
|
||||
bit = bits.next()
|
||||
bit = next(bits)
|
||||
trans_bit.append(bit)
|
||||
bit = ' '.join(trans_bit)
|
||||
split.append(bit)
|
||||
|
||||
@@ -66,7 +66,7 @@ class CycleNode(Node):
|
||||
# First time the node is rendered in template
|
||||
context.render_context[self] = itertools_cycle(self.cyclevars)
|
||||
cycle_iter = context.render_context[self]
|
||||
value = cycle_iter.next().resolve(context)
|
||||
value = next(cycle_iter).resolve(context)
|
||||
if self.variable_name:
|
||||
context[self.variable_name] = value
|
||||
if self.silent:
|
||||
|
||||
@@ -165,7 +165,7 @@ class IfParser(object):
|
||||
|
||||
self.tokens = mapped_tokens
|
||||
self.pos = 0
|
||||
self.current_token = self.next()
|
||||
self.current_token = next(self)
|
||||
|
||||
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 = self.next()
|
||||
self.current_token = next(self)
|
||||
left = t.nud(self)
|
||||
while rbp < self.current_token.lbp:
|
||||
t = self.current_token
|
||||
self.current_token = self.next()
|
||||
self.current_token = next(self)
|
||||
left = t.led(left, self)
|
||||
return left
|
||||
|
||||
|
||||
Reference in New Issue
Block a user