From e516c2474615711b37b0fd62e0962e96aa289091 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Tue, 14 Jun 2016 18:48:03 +0200 Subject: [PATCH] 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. --- discord/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/http.py b/discord/http.py index d83989204..26d6cc829 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