Fix _ValueCtxManager.__await__ typehint (#6163)

Co-authored-by: zephyrkul <zephyrkul@users.noreply.github.com>
This commit is contained in:
Zephyrkul
2023-07-19 13:13:54 -07:00
committed by GitHub
parent 8ee3ac9352
commit 48cfde7b8c

View File

@@ -9,6 +9,7 @@ from typing import (
AsyncContextManager, AsyncContextManager,
Awaitable, Awaitable,
Dict, Dict,
Generator,
MutableMapping, MutableMapping,
Optional, Optional,
Tuple, Tuple,
@@ -96,7 +97,7 @@ class _ValueCtxManager(Awaitable[_T], AsyncContextManager[_T]): # pylint: disab
self.__acquire_lock = acquire_lock self.__acquire_lock = acquire_lock
self.__lock = self.value_obj.get_lock() self.__lock = self.value_obj.get_lock()
def __await__(self) -> _T: def __await__(self) -> Generator[Any, None, _T]:
return self.coro.__await__() return self.coro.__await__()
async def __aenter__(self) -> _T: async def __aenter__(self) -> _T: