From: Harmon Date: Wed, 28 Aug 2019 16:16:27 +0000 (-0500) Subject: Fix handling of invalid credentials for API.verify_credentials X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f00d603411ae9108c4bdf468436c7ec753e96ace;p=tweepy.git Fix handling of invalid credentials for API.verify_credentials --- diff --git a/tweepy/api.py b/tweepy/api.py index 0dcc843..3e6897b 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -658,7 +658,7 @@ class API(object): 'include_email'], )(**kwargs) except TweepError as e: - if e.response and e.response.status == 401: + if e.response is not None and e.response.status_code == 401: return False raise