mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -05:00
Without these type-hints, I've found that PyCharm misidentifies the returned type, causing a number of false positives in static type checking.
(cherry picked from commit e878483318)
Co-authored-by: Toby Harradine <Tobotimus@users.noreply.github.com>
Co-authored-by: Toby Harradine <Tobotimus@users.noreply.github.com>
This commit is contained in:
@@ -89,10 +89,10 @@ 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):
|
def __await__(self) -> _T:
|
||||||
return self.coro.__await__()
|
return self.coro.__await__()
|
||||||
|
|
||||||
async def __aenter__(self):
|
async def __aenter__(self) -> _T:
|
||||||
if self.__acquire_lock is True:
|
if self.__acquire_lock is True:
|
||||||
await self.__lock.acquire()
|
await self.__lock.acquire()
|
||||||
self.raw_value = await self
|
self.raw_value = await self
|
||||||
|
|||||||
Reference in New Issue
Block a user