summaryrefslogtreecommitdiff
path: root/jinja2/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'jinja2/compiler.py')
-rw-r--r--jinja2/compiler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/jinja2/compiler.py b/jinja2/compiler.py
index b2ab6fe..30826f3 100644
--- a/jinja2/compiler.py
+++ b/jinja2/compiler.py
@@ -1129,6 +1129,13 @@ class CodeGenerator(NodeVisitor):
self.indent()
self.blockvisit(node.body, if_frame)
self.outdent()
+ for elif_ in node.elif_:
+ self.writeline('elif ', elif_)
+ self.visit(elif_.test, if_frame)
+ self.write(':')
+ self.indent()
+ self.blockvisit(elif_.body, if_frame)
+ self.outdent()
if node.else_:
self.writeline('else:')
self.indent()