diff options
| author | Rapptz <[email protected]> | 2021-04-04 04:40:19 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-04 07:03:53 -0400 |
| commit | 9d39b135f4f84239787b0901d06a4f370a82d4bb (patch) | |
| tree | 8826845cfd47eafa5c9d2ef1fcbedd36382714f4 /discord/errors.py | |
| parent | Bump minimum Python version to 3.8 (diff) | |
| download | discord.py-9d39b135f4f84239787b0901d06a4f370a82d4bb.tar.xz discord.py-9d39b135f4f84239787b0901d06a4f370a82d4bb.zip | |
Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by
default. It also changes some methods to use `yield from`.
Diffstat (limited to 'discord/errors.py')
| -rw-r--r-- | discord/errors.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/discord/errors.py b/discord/errors.py index 72470510..6e95010e 100644 --- a/discord/errors.py +++ b/discord/errors.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """ The MIT License (MIT) @@ -48,7 +46,7 @@ class GatewayNotFound(DiscordException): for the :class:`Client` websocket is not found.""" def __init__(self): message = 'The gateway to connect to discord was not found.' - super(GatewayNotFound, self).__init__(message) + super().__init__(message) def flatten_error_dict(d, key=''): items = [] @@ -174,7 +172,7 @@ class ConnectionClosed(ClientException): # aiohttp doesn't seem to consistently provide close reason self.reason = '' self.shard_id = shard_id - super().__init__('Shard ID %s WebSocket closed with %s' % (self.shard_id, self.code)) + super().__init__(f'Shard ID {self.shard_id} WebSocket closed with {self.code}') class PrivilegedIntentsRequired(ClientException): """Exception that's thrown when the gateway is requesting privileged intents |