Fix incorrect type cast (#4620)

Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
This commit is contained in:
peterychang 2024-12-09 17:28:19 -05:00 committed by GitHub
parent d96997232f
commit 51d4a10774
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,7 @@ InputFuncType = Union[SyncInputFunc, AsyncInputFunc]
# TODO: ainput doesn't seem to play nicely with jupyter.
# No input window appears in this case.
async def cancellable_input(prompt: str, cancellation_token: Optional[CancellationToken]) -> str:
task = asyncio.Task[str](asyncio.create_task(ainput(prompt))) # type: ignore
task: asyncio.Task[str] = asyncio.create_task(ainput(prompt)) # type: ignore
if cancellation_token is not None:
cancellation_token.link_future(task)
return await task