Tiny improvement for the loop hack. Implemented it in a way that the
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 13 Sep 2009 22:56:58 +0000 (15:56 -0700)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 13 Sep 2009 22:56:58 +0000 (15:56 -0700)
frame is not modified in the macro body generator.

--HG--
branch : trunk

jinja2/compiler.py

index 51790037d8e7714f9372d8da68ad6ce37ab42289..fa79f0ba0a586b091ded67c75352c36687e6bbbf 100644 (file)
@@ -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)