Fix several methods that should be async def, but aren't (#7107)

This commit is contained in:
Alex Waygood
2022-02-02 14:18:14 +00:00
committed by GitHub
parent 1b99812621
commit 584336a41e
4 changed files with 18 additions and 18 deletions

View File

@@ -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: ...