Skip to content

Commit 00d9d6a

Browse files
Merge pull request #357 from derek-dchu/master
Remove redundant checking for oauth_token & oauth_token_secret
2 parents 594f02f + 8eb8c2d commit 00d9d6a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

twython/api.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,10 @@ def __init__(self, app_key=None, app_secret=None, oauth_token=None,
103103
auth = None
104104
if oauth_version == 1:
105105
# User Authentication is through OAuth 1
106-
if self.app_key is not None and self.app_secret is not None and \
107-
self.oauth_token is None and self.oauth_token_secret is None:
108-
auth = OAuth1(self.app_key, self.app_secret)
109-
110-
if self.app_key is not None and self.app_secret is not None and \
111-
self.oauth_token is not None and self.oauth_token_secret is \
112-
not None:
106+
if self.app_key is not None and self.app_secret is not None:
113107
auth = OAuth1(self.app_key, self.app_secret,
114-
self.oauth_token, self.oauth_token_secret)
108+
self.oauth_token, self.oauth_token_secret)
109+
115110
elif oauth_version == 2 and self.access_token:
116111
# Application Authentication is through OAuth 2
117112
token = {'token_type': token_type,

0 commit comments

Comments
 (0)