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.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b404439a29b465cc5c65d8741a52dc8c9766a6ff;p=thirdparty%2Fjinja.git 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 51790037..fa79f0ba 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)