Skip to content

Commit

Permalink
Don't double-call user overrides of __aexit__
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshardmind committed Mar 27, 2024
1 parent 1adcf9e commit 463e78c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion discord/client.py
Expand Up @@ -304,7 +304,8 @@ async def __aexit__(
exc_value: Optional[BaseException],
traceback: Optional[TracebackType],
) -> None:
await self.close()
# Don't double-call user implementations
await (self.close() if self._closing_task is None else self._closing_task)

# internals

Expand Down

0 comments on commit 463e78c

Please sign in to comment.