Merge pull request #357 from derek-dchu/master
Remove redundant checking for oauth_token & oauth_token_secret
This commit is contained in:
commit
00d9d6a766
1 changed files with 3 additions and 8 deletions
|
|
@ -103,15 +103,10 @@ class Twython(EndpointsMixin, object):
|
||||||
auth = None
|
auth = None
|
||||||
if oauth_version == 1:
|
if oauth_version == 1:
|
||||||
# User Authentication is through OAuth 1
|
# User Authentication is through OAuth 1
|
||||||
if self.app_key is not None and self.app_secret is not None and \
|
if self.app_key is not None and self.app_secret is not None:
|
||||||
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:
|
|
||||||
auth = OAuth1(self.app_key, self.app_secret,
|
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:
|
elif oauth_version == 2 and self.access_token:
|
||||||
# Application Authentication is through OAuth 2
|
# Application Authentication is through OAuth 2
|
||||||
token = {'token_type': token_type,
|
token = {'token_type': token_type,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue