diff options
Diffstat (limited to 'src/jinja2/environment.py')
-rw-r--r-- | src/jinja2/environment.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jinja2/environment.py b/src/jinja2/environment.py index a94b5d8..85ac0b3 100644 --- a/src/jinja2/environment.py +++ b/src/jinja2/environment.py @@ -281,6 +281,8 @@ class Environment: #: :class:`~jinja2.compiler.CodeGenerator` for more information. code_generator_class: t.Type["CodeGenerator"] = CodeGenerator + concat = "".join + #: the context class that is used for templates. See #: :class:`~jinja2.runtime.Context` for more information. context_class: t.Type[Context] = Context @@ -1282,7 +1284,7 @@ class Template: ctx = self.new_context(dict(*args, **kwargs)) try: - return concat(self.root_render_func(ctx)) # type: ignore + return self.environment.concat(self.root_render_func(ctx)) # type: ignore except Exception: self.environment.handle_exception() @@ -1303,7 +1305,9 @@ class Template: ctx = self.new_context(dict(*args, **kwargs)) try: - return concat([n async for n in self.root_render_func(ctx)]) # type: ignore + return self.environment.concat( # type: ignore + [n async for n in self.root_render_func(ctx)] # type: ignore + ) except Exception: return self.environment.handle_exception() |