Skip to content

Commit 761748d

Browse files
committed
ruff
1 parent aa3df6e commit 761748d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/service-library/src/servicelib/redis/_semaphore_decorator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import logging
55
import socket
66
from collections.abc import AsyncIterator, Callable, Coroutine
7-
from contextlib import asynccontextmanager
8-
from typing import Any, AsyncContextManager, ParamSpec, TypeVar
7+
from contextlib import AbstractAsyncContextManager, asynccontextmanager
8+
from typing import Any, ParamSpec, TypeVar
99

1010
from common_library.async_tools import cancel_wait_task
1111

@@ -211,8 +211,8 @@ def with_limited_concurrency_cm(
211211
blocking: bool = True,
212212
blocking_timeout: datetime.timedelta | None = DEFAULT_SOCKET_TIMEOUT,
213213
) -> Callable[
214-
[Callable[P, AsyncContextManager[R]]],
215-
Callable[P, AsyncContextManager[R]],
214+
[Callable[P, AbstractAsyncContextManager[R]]],
215+
Callable[P, AbstractAsyncContextManager[R]],
216216
]:
217217
"""
218218
Decorator to limit concurrent execution of async context managers using a distributed semaphore.
@@ -247,8 +247,8 @@ async def get_cluster_client():
247247
"""
248248

249249
def _decorator(
250-
cm_func: Callable[P, AsyncContextManager[R]],
251-
) -> Callable[P, AsyncContextManager[R]]:
250+
cm_func: Callable[P, AbstractAsyncContextManager[R]],
251+
) -> Callable[P, AbstractAsyncContextManager[R]]:
252252
@functools.wraps(cm_func)
253253
@asynccontextmanager
254254
async def _wrapper(*args: P.args, **kwargs: P.kwargs) -> AsyncIterator[R]:

0 commit comments

Comments
 (0)