Deprecate OAuthHandler alias
authorHarmon <Harmon758@gmail.com>
Fri, 7 Jan 2022 13:51:36 +0000 (07:51 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 8 Jan 2022 00:19:27 +0000 (18:19 -0600)
tweepy/auth.py

index 276b565bf1439aa36b3a10924b71d4da347abfb1..120e28fc5d104f640381144ebd0405c0ecc0cf5a 100644 (file)
@@ -102,7 +102,22 @@ class OAuth1UserHandler:
         except Exception as e:
             raise TweepyException(e)
 
-OAuthHandler = OAuth1UserHandler
+
+class OAuthHandler(OAuth1UserHandler):
+    """Alias for :class:`OAuth1UserHandler`
+
+    .. deprecated:: 4.5
+        Use :class:`OAuth1UserHandler` instead.
+    """
+
+    def __init__(self, consumer_key, consumer_secret, access_token=None,
+                 access_token_secret=None, callback=None):
+        warnings.warn(
+            "OAuthHandler is deprecated; use OAuth1UserHandler instead.",
+            DeprecationWarning
+        )
+        super().__init__(consumer_key, consumer_secret, access_token, 
+                         access_token_secret, callback)
 
 
 class OAuth2AppHandler: