Simplify OAuthHandler
authorHarmon <Harmon758@gmail.com>
Fri, 7 Jan 2022 11:36:55 +0000 (05:36 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 8 Jan 2022 00:19:27 +0000 (18:19 -0600)
tweepy/auth.py

index c6b798e442aec93e94584b72d1222b4b17e5def2..d2c87260f10096dbeb248ae7decc2513f3a57af6 100644 (file)
@@ -29,9 +29,6 @@ class AuthHandler:
 
 
 class OAuthHandler(AuthHandler):
-    """OAuth authentication handler"""
-    OAUTH_HOST = 'api.twitter.com'
-    OAUTH_ROOT = '/oauth/'
 
     def __init__(self, consumer_key, consumer_secret, callback=None):
         if not isinstance(consumer_key, (str, bytes)):
@@ -53,7 +50,7 @@ class OAuthHandler(AuthHandler):
                                    callback_uri=self.callback)
 
     def _get_oauth_url(self, endpoint):
-        return 'https://' + self.OAUTH_HOST + self.OAUTH_ROOT + endpoint
+        return 'https://api.twitter.com/oauth/' + endpoint
 
     def apply_auth(self):
         return OAuth1(self.consumer_key,