Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Same thing for extensions.

--HG--
branch : trunk
  • Loading branch information...
commit 7647d1c17d3b1e63cc8562b632981375c08019a9 1 parent 272ca2a
@mitsuhiko authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 jinja2/ext.py
View
12 jinja2/ext.py
@@ -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')
@@ -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:
@@ -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' %
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.