|
1 | 1 | from collections.abc import Awaitable, Callable, Generator |
| 2 | +from contextlib import AbstractAsyncContextManager |
2 | 3 | from functools import wraps |
3 | 4 | from typing import NewType, ParamSpec, TypeVar, cast, final |
4 | | -from contextlib import AbstractAsyncContextManager |
5 | 5 |
|
6 | 6 | # Try to use anyio.Lock, fall back to asyncio.Lock |
7 | 7 | # Note: anyio is required for proper trio support |
|
10 | 10 | except ImportError: # pragma: no cover |
11 | 11 | import asyncio # noqa: WPS433 |
12 | 12 |
|
13 | | - Lock:AbstractAsyncContextManager = asyncio.Lock |
| 13 | + Lock: AbstractAsyncContextManager = asyncio.Lock |
14 | 14 | else: |
15 | | - Lock:AbstractAsyncContextManager = anyio.Lock |
| 15 | + Lock: AbstractAsyncContextManager = anyio.Lock |
16 | 16 |
|
17 | 17 | _ValueType = TypeVar('_ValueType') |
18 | 18 | _AwaitableT = TypeVar('_AwaitableT', bound=Awaitable) |
@@ -57,7 +57,7 @@ class ReAwaitable: |
57 | 57 |
|
58 | 58 | We try to make this type transparent. |
59 | 59 | It should not actually be visible to any of its users. |
60 | | - |
| 60 | +
|
61 | 61 | Note: |
62 | 62 | For proper trio support, the anyio library is required. |
63 | 63 | If anyio is not available, we fall back to asyncio.Lock. |
@@ -144,7 +144,7 @@ def reawaitable( |
144 | 144 | ... return await instance + await instance + await instance |
145 | 145 |
|
146 | 146 | >>> assert anyio.run(main) == 3 |
147 | | - |
| 147 | +
|
148 | 148 | Note: |
149 | 149 | For proper trio support, the anyio library is required. |
150 | 150 | If anyio is not available, we fall back to asyncio.Lock. |
|
0 commit comments