diff options
| author | Rapptz <[email protected]> | 2015-12-10 04:52:20 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-12-10 04:52:20 -0500 |
| commit | 783423604416e00aca2eda088be24ca9b4f525a3 (patch) | |
| tree | b4996419e7ad17cbb180af9b7997420a56f9f3c4 | |
| parent | Fix bug where Role.is_everyone doesn't propagate in GUILD_ROLE_UPDATE. (diff) | |
| download | discord.py-783423604416e00aca2eda088be24ca9b4f525a3.tar.xz discord.py-783423604416e00aca2eda088be24ca9b4f525a3.zip | |
Close the ClientSession in __del__.
| -rw-r--r-- | discord/client.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py index bb70ac4e..f3830f8f 100644 --- a/discord/client.py +++ b/discord/client.py @@ -125,6 +125,10 @@ class Client: self._voice_data_found = asyncio.Event(loop=self.loop) self._session_id_found = asyncio.Event(loop=self.loop) + def __del__(self): + if hasattr(self, 'session'): + self.session.close() + # internals def handle_message(self, message): |