]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Clarified for else todo
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 3 Jan 2017 00:37:35 +0000 (01:37 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 3 Jan 2017 22:45:29 +0000 (23:45 +0100)
jinja2/compiler.py

index 03866b52be2f1cf540d058d845fee140ed12b634..a7fb325cb70e5f46438d4cdd7170203abbf545f0 100644 (file)
@@ -842,7 +842,8 @@ class CodeGenerator(NodeVisitor):
 
     def visit_For(self, node, frame):
         # TODO: this should really use two frames: one for the loop body
-        # and a separate one for the loop else block.
+        # and a separate one for the loop else block.  This also is needed
+        # because the loop variable must not be visible in the else block
         loop_frame = frame.inner()
 
         # try to figure out if we have an extended loop.  An extended loop