diff options
| author | Hornwitser <[email protected]> | 2018-08-01 11:41:15 +0200 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-11-24 22:17:57 -0500 |
| commit | fa46b07db15f5ce41be3f4944d2ff011794207d5 (patch) | |
| tree | 0a87a0731c797cfadb69f7812ee4813628b4eba2 /discord/http.py | |
| parent | [lint] Remove redundant exception variables (diff) | |
| download | discord.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/http.py')
| -rw-r--r-- | discord/http.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/discord/http.py b/discord/http.py index 93e9708d..7fc6abda 100644 --- a/discord/http.py +++ b/discord/http.py @@ -244,10 +244,10 @@ class HTTPClient: try: data = await self.request(Route('GET', '/users/@me')) - except HTTPException as e: + except HTTPException as exc: self._token(old_token, bot=old_bot) - if e.response.status == 401: - raise LoginFailure('Improper token has been passed.') from e + if exc.response.status == 401: + raise LoginFailure('Improper token has been passed.') from exc raise return data @@ -742,8 +742,8 @@ class HTTPClient: async def get_gateway(self, *, encoding='json', v=6, zlib=True): try: data = await self.request(Route('GET', '/gateway')) - except HTTPException as e: - raise GatewayNotFound() from e + except HTTPException as exc: + raise GatewayNotFound() from exc if zlib: value = '{0}?encoding={1}&v={2}&compress=zlib-stream' else: @@ -753,8 +753,8 @@ class HTTPClient: async def get_bot_gateway(self, *, encoding='json', v=6, zlib=True): try: data = await self.request(Route('GET', '/gateway/bot')) - except HTTPException as e: - raise GatewayNotFound() from e + except HTTPException as exc: + raise GatewayNotFound() from exc if zlib: value = '{0}?encoding={1}&v={2}&compress=zlib-stream' |