Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pallets/jinja
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1bb35c36df9e5504d092adb88b2475673c9954e5
Choose a base ref
..
head repository: pallets/jinja
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e644b2096ebc9fd1b09f71de83760eacc2277f24
Choose a head ref
Showing with 5 additions and 2 deletions.
  1. +3 −1 src/jinja2/runtime.py
  2. +2 −1 tests/test_nativetypes.py
4 changes: 3 additions & 1 deletion src/jinja2/runtime.py
Original file line number Diff line number Diff line change
@@ -376,7 +376,9 @@ def __call__(self) -> str:
if self._context.environment.is_async:
return self._async_call() # type: ignore

rv = self._context.environment.concat(self._stack[self._depth](self._context)) # type: ignore
rv = self._context.environment.concat( # type: ignore
self._stack[self._depth](self._context)
)

if self._context.eval_ctx.autoescape:
return Markup(rv)
3 changes: 2 additions & 1 deletion tests/test_nativetypes.py
Original file line number Diff line number Diff line change
@@ -164,7 +164,8 @@ def test_macro(env):

def test_block(env):
t = env.from_string(
"{% block b %}{% for i in range(1) %}{{ loop.index }}{% endfor %}{% endblock %}{{ self.b() }}"
"{% block b %}{% for i in range(1) %}{{ loop.index }}{% endfor %}"
"{% endblock %}{{ self.b() }}"
)
result = t.render()
assert result == 11