Skip to content

Commit

Permalink
Remove redundant checking for oauth_token & oauth_token_secret
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-dchu committed Nov 19, 2014
1 parent 245873b commit 8eb8c2d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions twython/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,10 @@ def __init__(self, app_key=None, app_secret=None, oauth_token=None,
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,
Expand Down

0 comments on commit 8eb8c2d

Please sign in to comment.