diff options
| author | Hornwitser <[email protected]> | 2016-06-14 18:48:03 +0200 |
|---|---|---|
| committer | Hornwitser <[email protected]> | 2016-06-14 18:52:48 +0200 |
| commit | e516c2474615711b37b0fd62e0962e96aa289091 (patch) | |
| tree | be8167d719bb5f7f30c28226f2290fc63c827d0c /discord/http.py | |
| parent | [commands] Only show CommandNotFound on non-empty commands. (diff) | |
| download | discord.py-e516c2474615711b37b0fd62e0962e96aa289091.tar.xz discord.py-e516c2474615711b37b0fd62e0962e96aa289091.zip | |
Fix exception when handling login failure
Logging in with an invalid token would throw a TypeError due to improper
passing of arguments to HTTPClient._token. Fix by properly passing the
keyword only bot argument.
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py index d8398920..26d6cc82 100644 --- a/discord/http.py +++ b/discord/http.py @@ -189,13 +189,13 @@ class HTTPClient: @asyncio.coroutine def static_login(self, token, *, bot): - old_state = (self.token, self.bot_token) + old_token, old_bot = self.token, self.bot_token self._token(token, bot=bot) try: data = yield from self.get(self.ME) except HTTPException as e: - self._token(*old_state) + self._token(old_token, bot=old_bot) if e.response.status == 401: raise LoginFailure('Improper token has been passed.') from e raise e |