fix(asyncify.py): fix linting errors

This commit is contained in:
Krrish Dholakia 2024-08-23 20:50:13 -07:00
parent d12ec470f7
commit d02cfcde97

View file

@ -1,5 +1,5 @@
import functools import functools
from typing import Awaitable, Callable from typing import Awaitable, Callable, Optional
import anyio import anyio
from anyio import to_thread from anyio import to_thread
@ -21,7 +21,7 @@ def asyncify(
function: Callable[T_ParamSpec, T_Retval], function: Callable[T_ParamSpec, T_Retval],
*, *,
cancellable: bool = False, cancellable: bool = False,
limiter: anyio.CapacityLimiter | None = None, limiter: Optional[anyio.CapacityLimiter] = None,
) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: ) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
""" """
Take a blocking function and create an async one that receives the same Take a blocking function and create an async one that receives the same