From f3c66d92523aa2760d6f904bf4ec56017fb363c6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher <armin.ronacher@active-4.com> Date: Mon, 15 Mar 2010 00:48:46 +0100 Subject: [PATCH] Fixed a testcase for Python 2.4 --HG-- branch : trunk --- jinja2/compiler.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 3bc6d35..2952b66 100644 --- a/jinja2/compiler.py +++ b/jinja2/compiler.py @@ -439,15 +439,19 @@ class CodeGenerator(NodeVisitor): def return_buffer_contents(self, frame): """Return the buffer contents of the frame.""" - self.writeline('return ') if frame.eval_ctx.volatile: - self.write('(Markup(concat(%s)) if context.eval_ctx' - '.autoescape else concat(%s))' % - (frame.buffer, frame.buffer)) + self.writeline('if context.eval_ctx.autoescape:') + self.indent() + self.writeline('return Markup(concat(%s))' % frame.buffer) + self.outdent() + self.writeline('else:') + self.indent() + self.writeline('return concat(%s)' % frame.buffer) + self.outdent() elif frame.eval_ctx.autoescape: - self.write('Markup(concat(%s))' % frame.buffer) + self.writeline('return Markup(concat(%s))' % frame.buffer) else: - self.write('concat(%s)' % frame.buffer) + self.writeline('return concat(%s)' % frame.buffer) def indent(self): """Indent by one.""" -- 2.26.2