aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorHornwitser <[email protected]>2018-08-01 11:41:15 +0200
committerRapptz <[email protected]>2018-11-24 22:17:57 -0500
commitfa46b07db15f5ce41be3f4944d2ff011794207d5 (patch)
tree0a87a0731c797cfadb69f7812ee4813628b4eba2 /discord/client.py
parent[lint] Remove redundant exception variables (diff)
downloaddiscord.py-fa46b07db15f5ce41be3f4944d2ff011794207d5.tar.xz
discord.py-fa46b07db15f5ce41be3f4944d2ff011794207d5.zip
[lint] Rename exception variables to exc
Use the more explicit (and common) exc instead of e as the variable holding the exception in except handlers.
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/discord/client.py b/discord/client.py
index 6251e65e..e5269828 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -246,8 +246,8 @@ class Client:
try:
result = condition(*args)
- except Exception as e:
- future.set_exception(e)
+ except Exception as exc:
+ future.set_exception(exc)
removed.append(i)
else:
if result:
@@ -406,11 +406,11 @@ class Client:
aiohttp.ClientError,
asyncio.TimeoutError,
websockets.InvalidHandshake,
- websockets.WebSocketProtocolError) as e:
+ websockets.WebSocketProtocolError) as exc:
if not reconnect:
await self.close()
- if isinstance(e, ConnectionClosed) and e.code == 1000:
+ if isinstance(exc, ConnectionClosed) and exc.code == 1000:
# clean close, don't re-raise this
return
raise
@@ -422,8 +422,8 @@ class Client:
# such as a clean disconnect (1000) or a bad state (bad token, no sharding, etc)
# sometimes, discord sends us 1000 for unknown reasons so we should reconnect
# regardless and rely on is_closed instead
- if isinstance(e, ConnectionClosed):
- if e.code != 1000:
+ if isinstance(exc, ConnectionClosed):
+ if exc.code != 1000:
await self.close()
raise