From 8eb8c2dd556bb0efed9cd8f0e77ccfa59e7c0d82 Mon Sep 17 00:00:00 2001 From: Derek Hu Date: Wed, 19 Nov 2014 01:09:02 -0500 Subject: [PATCH] Remove redundant checking for oauth_token & oauth_token_secret --- twython/api.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/twython/api.py b/twython/api.py index 0b421c3..e7e0046 100644 --- a/twython/api.py +++ b/twython/api.py @@ -102,15 +102,10 @@ class Twython(EndpointsMixin, object): auth = None if oauth_version == 1: # User Authentication is through OAuth 1 - if self.app_key is not None and self.app_secret is not None and \ - self.oauth_token is None and self.oauth_token_secret is None: - auth = OAuth1(self.app_key, self.app_secret) - - if self.app_key is not None and self.app_secret is not None and \ - self.oauth_token is not None and self.oauth_token_secret is \ - not None: + if self.app_key is not None and self.app_secret is not None: auth = OAuth1(self.app_key, self.app_secret, - self.oauth_token, self.oauth_token_secret) + self.oauth_token, self.oauth_token_secret) + elif oauth_version == 2 and self.access_token: # Application Authentication is through OAuth 2 token = {'token_type': token_type,