Skip to content

Commit

Permalink
Add missing debug_info mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Jan 29, 2017
1 parent 283a6f2 commit 3f6cddd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jinja2/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,10 @@ def visit_Output(self, node, frame):
# try to evaluate as many chunks as possible into a static
# string at compile time.
body = []
child_lineno = 0
for child in node.nodes:
try:
child_lineno = child.lineno
if not allow_constant_finalize:
raise nodes.Impossible()
const = child.as_const(frame.eval_ctx)
Expand Down Expand Up @@ -1278,6 +1280,7 @@ def visit_Output(self, node, frame):
else:
self.writeline('%s.extend((' % frame.buffer)
self.indent()
self._write_debug_info = child_lineno
for item in body:
if isinstance(item, list):
val = repr(concat(item))
Expand Down Expand Up @@ -1317,6 +1320,7 @@ def visit_Output(self, node, frame):
else:
format = []
arguments = []
self._write_debug_info = child_lineno
for item in body:
if isinstance(item, list):
format.append(concat(item).replace('%', '%%'))
Expand Down

0 comments on commit 3f6cddd

Please sign in to comment.