From d4ceb1aedba5380d95c8efee7d21f5e478715fe6 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 7 Jan 2022 07:45:24 -0600 Subject: [PATCH] Deprecate AppAuthHandler alias --- tweepy/auth.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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): -- 2.25.1