From b404439a29b465cc5c65d8741a52dc8c9766a6ff Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 13 Sep 2009 15:56:58 -0700 Subject: [PATCH] Tiny improvement for the loop hack. Implemented it in a way that the frame is not modified in the macro body generator. --HG-- branch : trunk --- jinja2/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 5179003..fa79f0b 100644 --- a/jinja2/compiler.py +++ b/jinja2/compiler.py @@ -655,7 +655,7 @@ class CodeGenerator(NodeVisitor): # leaking into a new python frame and might be used both unassigned # and assigned. if 'loop' in frame.identifiers.declared: - args.append('l_loop=l_loop') + args = args + ['l_loop=l_loop'] self.writeline('def macro(%s):' % ', '.join(args), node) self.indent() self.buffer(frame) -- 2.26.2