From: Harmon Date: Fri, 7 Jan 2022 13:45:24 +0000 (-0600) Subject: Deprecate AppAuthHandler alias X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d4ceb1aedba5380d95c8efee7d21f5e478715fe6;p=tweepy.git Deprecate AppAuthHandler alias --- diff --git a/tweepy/auth.py b/tweepy/auth.py index 37af86a..276b565 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -7,6 +7,7 @@ from hashlib import sha256 import logging from urllib.parse import parse_qs import secrets +import warnings import requests from requests.auth import AuthBase, HTTPBasicAuth @@ -126,7 +127,20 @@ class OAuth2AppHandler: def apply_auth(self): return OAuth2BearerHandler(self._bearer_token) -AppAuthHandler = OAuth2AppHandler + +class AppAuthHandler(OAuth2AppHandler): + """Alias for :class:`OAuth2AppHandler` + + .. deprecated:: 4.5 + Use :class:`OAuth2AppHandler` instead. + """ + + def __init__(self, consumer_key, consumer_secret): + warnings.warn( + "AppAuthHandler is deprecated; use OAuth2AppHandler instead.", + DeprecationWarning + ) + super().__init__(consumer_key, consumer_secret) class OAuth2BearerHandler(AuthBase):