From: Armin Ronacher Date: Sun, 13 Sep 2009 22:56:58 +0000 (-0700) Subject: Tiny improvement for the loop hack. Implemented it in a way that the X-Git-Tag: 2.2.1~2 X-Git-Url: http://git.tremily.us/?p=jinja2.git;a=commitdiff_plain;h=b404439a29b465cc5c65d8741a52dc8c9766a6ff 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 --- 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)