From: Kevin Date: Thu, 14 May 2020 03:05:52 +0000 (-0400) Subject: Properly set environment on parsed template X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e20ca14bf48ab9e8c962794b72503069823d5f7;p=thirdparty%2Fjinja.git Properly set environment on parsed template --- diff --git a/src/jinja2/parser.py b/src/jinja2/parser.py index 7cb55fdd..a77d0547 100644 --- a/src/jinja2/parser.py +++ b/src/jinja2/parser.py @@ -943,11 +943,16 @@ class Parser: """Parse the whole template into a `Template` node.""" from .new_parser import JinjaSemantics, parse_template - return parse_template( + result = parse_template( grammar.parse( self.source, whitespace='', parseinfo=True, semantics=JinjaSemantics(), + trace=True, + colorize=True, ) ) + result.set_environment(self.environment) + + return result