Skip to content

Commit 0cf915e

Browse files
committed
* new Upstream
1 parent 6fb949d commit 0cf915e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ A Simple Example
5454
click.echo(f"Hello, {name}!")
5555

5656
if __name__ == '__main__':
57-
hello(_anyio_backend="trio") # or asyncio, or curio
57+
hello(_anyio_backend="trio") # or asyncio
5858

5959
.. note::
6060
AsyncClick automagically starts an anyio event loop and runs your

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
asyncclick (1:8.1.3-2) unstable; urgency=medium
2+
3+
* new Upstream
4+
5+
-- Matthias Urlichs <[email protected]> Tue, 07 Jun 2022 18:53:38 +0200
6+
17
asyncclick (1:8.0.3-6) unstable; urgency=medium
28

39
* fix test

src/asyncclick/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,10 +1146,15 @@ async def _main_shell_completion(
11461146
rv = await shell_complete(self, ctx_args, prog_name, complete_var, instruction)
11471147
sys.exit(rv)
11481148

1149-
def __call__(self, *args: t.Any, _anyio_backend: str = None, **kwargs: t.Any) -> t.Any:
1149+
def __call__(self, *args: t.Any, _anyio_backend: str = None, _anyio_backend_options: dict = {}, **kwargs: t.Any) -> t.Any:
11501150
"""Alias for :meth:`main`."""
11511151
main = self.main
1152-
return anyio.run(self._main, main, args, kwargs, **({"backend":_anyio_backend} if _anyio_backend is not None else {}))
1152+
opts = {}
1153+
if _anyio_backend:
1154+
opts["backend"] = _anyio_backend
1155+
if _anyio_backend_options:
1156+
opts["backend_options"] = _anyio_backend_options
1157+
return anyio.run(self._main, main, args, kwargs, **opts)
11531158

11541159
async def _main(self, main, args, kwargs):
11551160
return await main(*args, **kwargs)

0 commit comments

Comments
 (0)