mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Fix several methods that should be async def, but aren't (#7107)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from collections import deque
|
||||
from types import TracebackType
|
||||
from typing import Any, Awaitable, Callable, Generator, TypeVar
|
||||
from typing import Any, Callable, Generator, TypeVar
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
from .futures import Future
|
||||
@@ -11,10 +11,10 @@ _T = TypeVar("_T")
|
||||
if sys.version_info >= (3, 9):
|
||||
class _ContextManagerMixin:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
def __aenter__(self) -> Awaitable[None]: ...
|
||||
def __aexit__(
|
||||
async def __aenter__(self) -> None: ...
|
||||
async def __aexit__(
|
||||
self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
|
||||
) -> Awaitable[None]: ...
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
class _ContextManager:
|
||||
@@ -29,10 +29,10 @@ else:
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
def __iter__(self) -> Generator[Any, None, _ContextManager]: ...
|
||||
def __await__(self) -> Generator[Any, None, _ContextManager]: ...
|
||||
def __aenter__(self) -> Awaitable[None]: ...
|
||||
def __aexit__(
|
||||
async def __aenter__(self) -> None: ...
|
||||
async def __aexit__(
|
||||
self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None
|
||||
) -> Awaitable[None]: ...
|
||||
) -> None: ...
|
||||
|
||||
class Lock(_ContextManagerMixin):
|
||||
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user