Skip to content

Commit

Permalink
Same thing for extensions.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
mitsuhiko committed Jan 5, 2009
1 parent 272ca2a commit 7647d1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jinja2/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def parse(self, parser):
# a later state.
plural_expr = None
variables = {}
while parser.stream.current.type is not 'block_end':
while parser.stream.current.type != 'block_end':
if variables:
parser.stream.expect('comma')

Expand All @@ -189,7 +189,7 @@ def parse(self, parser):
exc=TemplateAssertionError)

# expressions
if parser.stream.current.type is 'assign':
if parser.stream.current.type == 'assign':
parser.stream.next()
variables[name.value] = var = parser.parse_expression()
else:
Expand All @@ -214,7 +214,7 @@ def parse(self, parser):
if parser.stream.current.test('name:pluralize'):
have_plural = True
parser.stream.next()
if parser.stream.current.type is not 'block_end':
if parser.stream.current.type != 'block_end':
name = parser.stream.expect('name')
if name.value not in variables:
parser.fail('unknown variable %r for pluralization' %
Expand Down Expand Up @@ -259,16 +259,16 @@ def _parse_block(self, parser, allow_pluralize):
referenced = []
buf = []
while 1:
if parser.stream.current.type is 'data':
if parser.stream.current.type == 'data':
buf.append(parser.stream.current.value.replace('%', '%%'))
parser.stream.next()
elif parser.stream.current.type is 'variable_begin':
elif parser.stream.current.type == 'variable_begin':
parser.stream.next()
name = parser.stream.expect('name').value
referenced.append(name)
buf.append('%%(%s)s' % name)
parser.stream.expect('variable_end')
elif parser.stream.current.type is 'block_begin':
elif parser.stream.current.type == 'block_begin':
parser.stream.next()
if parser.stream.current.test('name:endtrans'):
break
Expand Down

0 comments on commit 7647d1c

Please sign in to comment.