From a8ff5d3d661cb0de94f2322d5c32089e9d4c38c6 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 7 Jan 2022 05:42:21 -0600 Subject: [PATCH] Improve OAuth2AppHandler formatting --- tweepy/auth.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tweepy/auth.py b/tweepy/auth.py index d2c8726..9ae2056 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -137,10 +137,11 @@ class OAuth2AppHandler(AuthHandler): self.consumer_secret = consumer_secret self._bearer_token = '' - resp = requests.post('https://api.twitter.com/oauth2/token', - auth=(self.consumer_key, - self.consumer_secret), - data={'grant_type': 'client_credentials'}) + resp = requests.post( + 'https://api.twitter.com/oauth2/token', + auth=(self.consumer_key, self.consumer_secret), + data={'grant_type': 'client_credentials'} + ) data = resp.json() if data.get('token_type') != 'bearer': raise TweepyException('Expected token_type to equal "bearer", ' -- 2.25.1