From f00d603411ae9108c4bdf468436c7ec753e96ace Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 28 Aug 2019 11:16:27 -0500 Subject: [PATCH] Fix handling of invalid credentials for API.verify_credentials --- tweepy/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.25.1