Fix handling of invalid credentials for API.verify_credentials
authorHarmon <Harmon758@gmail.com>
Wed, 28 Aug 2019 16:16:27 +0000 (11:16 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 28 Aug 2019 16:16:27 +0000 (11:16 -0500)
tweepy/api.py

index 0dcc84344a74df661d38520889efb562a7ffd642..3e6897ba16fd805be05c5a907ba6ce077e47c489 100644 (file)
@@ -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