From: Kevin Date: Sun, 10 May 2020 21:01:33 +0000 (-0400) Subject: Fixed elif/else sections of if node being None X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b091d41a543e894f3f7ae141532bc0ca74eff037;p=thirdparty%2Fjinja.git Fixed elif/else sections of if node being None The default should be an empty list to match the existing AST but we were incorrectly setting it to `None`. --- diff --git a/new_parser.py b/new_parser.py index 5e517387..b61b3d71 100644 --- a/new_parser.py +++ b/new_parser.py @@ -164,8 +164,8 @@ def parse_block_from(ast): def parse_block_if(ast): test = parse_conditional_expression(ast['start']['parameters'][0]['value']) body = parse(ast['contents']) - elif_ = None - else_ = None + elif_ = [] + else_ = [] return nodes.If( test,