Skip to content

Commit

Permalink
return an aclose-able AsyncGenerator from Template.generate_async
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored and davidism committed May 11, 2024
1 parent 0cb1dbd commit dd320dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
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
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

0 comments on commit dd320dc

Please sign in to comment.