Fix conv.wait_event no longer raising Timeout

Should properly fix #1618.
This commit is contained in:
Lonami 2020-11-13 09:53:00 +01:00 committed by GitHub
parent ab9035acd2
commit 46ee8e86c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -338,10 +338,10 @@ class Conversation(ChatGetter):
self._custom[counter] = (event, future) self._custom[counter] = (event, future)
try: try:
return await self._get_result(future, start_time, timeout, self._custom, counter) return await self._get_result(future, start_time, timeout, self._custom, counter)
except asyncio.TimeoutError: finally:
# Need to remove it from the dict if it times out, else we may # Need to remove it from the dict if it times out, else we may
# try and fail to set the result later (#1618). # try and fail to set the result later (#1618).
del self._custom[counter] self._custom.pop(counter, None)
async def _check_custom(self, built): async def _check_custom(self, built):
for key, (ev, fut) in list(self._custom.items()): for key, (ev, fut) in list(self._custom.items()):