From 529d7936201f05f4167225be3bbcaf38eafadb8c Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 7 Jan 2022 05:06:47 -0600 Subject: [PATCH] Rename AppAuthHandler to Oauth2AppHandler Keep AppAuthHandler as deprecated alias --- tweepy/__init__.py | 4 +++- tweepy/auth.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tweepy/__init__.py b/tweepy/__init__.py index 6db021d..3747b1b 100644 --- a/tweepy/__init__.py +++ b/tweepy/__init__.py @@ -10,7 +10,9 @@ __author__ = 'Joshua Roesslein' __license__ = 'MIT' from tweepy.api import API -from tweepy.auth import AppAuthHandler, OAuthHandler, OAuth2Handler +from tweepy.auth import ( + AppAuthHandler, OAuthHandler, OAuth2AppHandler, OAuth2Handler +) from tweepy.cache import Cache, FileCache, MemoryCache from tweepy.client import Client, Response from tweepy.cursor import Cursor diff --git a/tweepy/auth.py b/tweepy/auth.py index 3f92dd1..d8b30ac 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -173,7 +173,7 @@ class OAuth2Bearer(AuthBase): return request -class AppAuthHandler(AuthHandler): +class OAuth2AppHandler(AuthHandler): """Application-only authentication handler""" OAUTH_HOST = 'api.twitter.com' @@ -200,3 +200,5 @@ class AppAuthHandler(AuthHandler): def apply_auth(self): return OAuth2Bearer(self._bearer_token) + +AppAuthHandler = OAuth2AppHandler -- 2.25.1