Index: third_party/jinja2/parser.py |
diff --git a/third_party/jinja2/parser.py b/third_party/jinja2/parser.py |
index d44229ad0f09a562bbf67de4a5daf5d5730456ab..f60cd018c51fff457dfaea5283b78267a4a0eefd 100644 |
--- a/third_party/jinja2/parser.py |
+++ b/third_party/jinja2/parser.py |
@@ -10,8 +10,8 @@ |
""" |
from jinja2 import nodes |
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError |
-from jinja2.utils import next |
from jinja2.lexer import describe_token, describe_token_expr |
+from jinja2._compat import next, imap |
#: statements that callinto |
@@ -53,7 +53,7 @@ class Parser(object): |
def _fail_ut_eof(self, name, end_token_stack, lineno): |
expected = [] |
for exprs in end_token_stack: |
- expected.extend(map(describe_token_expr, exprs)) |
+ expected.extend(imap(describe_token_expr, exprs)) |
if end_token_stack: |
currently_looking = ' or '.join( |
"'%s'" % describe_token_expr(expr) |
@@ -223,7 +223,7 @@ class Parser(object): |
# raise a nicer error message in that case. |
if self.stream.current.type == 'sub': |
self.fail('Block names in Jinja have to be valid Python ' |
- 'identifiers and may not contain hypens, use an ' |
+ 'identifiers and may not contain hyphens, use an ' |
'underscore instead.') |
node.body = self.parse_statements(('name:endblock',), drop_needle=True) |
@@ -698,7 +698,6 @@ class Parser(object): |
arg = nodes.Const(attr_token.value, lineno=attr_token.lineno) |
return nodes.Getitem(node, arg, 'load', lineno=token.lineno) |
if token.type == 'lbracket': |
- priority_on_attribute = False |
args = [] |
while self.stream.current.type != 'rbracket': |
if args: |