Skip to content

test on trio, fix all missing aclose related warnings #1960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 11, 2024
Prev Previous commit
Next Next commit
return an aclose-able AsyncGenerator from Template.generate_async
Fixes #1955
  • Loading branch information
graingert authored and davidism committed May 11, 2024
commit dd320dc3d11364cd42799308b01a5776618ffb23
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Unreleased
- Calling sync ``render`` for an async template uses ``asyncio.run``.
:pr:`1952`
- Avoid unclosed ``auto_aiter`` warnings. :pr:`1960`
- Return an ``aclose``-able ``AsyncGenerator`` from
``Template.generate_async``. :pr:`1960`


Version 3.1.4
Expand Down
2 changes: 1 addition & 1 deletion src/jinja2/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ async def to_list() -> t.List[str]:

async def generate_async(
self, *args: t.Any, **kwargs: t.Any
) -> t.AsyncIterator[str]:
) -> t.AsyncGenerator[str, object]:
"""An async version of :meth:`generate`. Works very similarly but
returns an async iterator instead.
"""
Expand Down