Skip to content

Commit

Permalink
Deprecate AppAuthHandler alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Jan 8, 2022
1 parent fb6eb7d commit d4ceb1a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tweepy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
from urllib.parse import parse_qs
import secrets
import warnings

import requests
from requests.auth import AuthBase, HTTPBasicAuth
Expand Down Expand Up @@ -126,7 +127,20 @@ def __init__(self, consumer_key, consumer_secret):
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):
Expand Down

0 comments on commit d4ceb1a

Please sign in to comment.