Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/asyncclick/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ async def _main_shell_completion(
def __call__(
self,
*args: t.Any,
_anyio_backend: str | None = None,
_anyio_backend: str | None,
_anyio_backend_options: dict[str, t.Any] | None = None,
**kwargs: t.Any,
) -> t.Any:
Expand All @@ -1529,6 +1529,9 @@ def __call__(
If you are already inside an async event loop, call
``await`` :meth:`main` instead.

If no backend is found and anyio is not installed, then ``asyncio`` is
used for the backend.

:param _anyio_backend: The backend to use for the event loop.
:param _anyio_backend_options: Any options to pass to the backend.

Expand All @@ -1553,7 +1556,7 @@ def __call__(
import trio

return trio.run(self._main, main, args, kwargs)
if _anyio_backend == "asyncio":
if _anyio_backend == "asyncio" or _anyio_backend is None:
import asyncio

return asyncio.run(self._main(main, args, kwargs))
Expand Down
Loading