Skip to content

Commit ff2cceb

Browse files
committed
Fix mypy annoyance
1 parent 0f971b6 commit ff2cceb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/asyncclick/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ def __call__(
15471547
opts["backend"] = _anyio_backend
15481548
if _anyio_backend_options:
15491549
opts["backend_options"] = _anyio_backend_options
1550-
return anyio.run(self._main, main, args, kwargs, **opts) # type:ignore
1550+
return anyio.run(self._main, main, args, kwargs, **opts)
15511551

15521552
if _anyio_backend == "trio":
15531553
import trio

src/asyncclick/termui.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ def prompt_func(text: str) -> str:
165165
echo(None, err=err)
166166
raise Abort() from None
167167

168+
run_prompt_func: t.Callable[[str], t.Awaitable[str]]
168169
if blocking:
169170

170171
async def run_prompt_func(text: str) -> str:
171172
return prompt_func(text)
172173
else:
173174

174-
async def run_prompt_func(text: str) -> str:
175-
return await anyio.to_thread.run_sync(prompt_func, text)
175+
def run_prompt_func(text: str) -> t.Awaitable[str]:
176+
return anyio.to_thread.run_sync(prompt_func, text)
176177

177178
if value_proc is None:
178179
value_proc = convert_type(type, default)

0 commit comments

Comments
 (0)