Fix AttributeError in OAuth version detection.
Old versions of OAuth didn't have _version attribute, so Twython crashes on them with AttributeError. This version first checks if there is _version attribute. If no, obviously it's an old version.
This commit is contained in:
parent
d6d8823dc2
commit
5a155d4b7c
1 changed files with 1 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ except ImportError:
|
|||
# url as part of the request object; older versions we need to patch for Python 2.5... ugh. ;P
|
||||
OAUTH_CALLBACK_IN_URL = False
|
||||
OAUTH_LIB_SUPPORTS_CALLBACK = False
|
||||
if float(oauth._version.manual_verstr) <= 1.4:
|
||||
if not hasattr(oauth, '_version') or float(oauth._version.manual_verstr) <= 1.4:
|
||||
OAUTH_CLIENT_INSPECTION = inspect.getargspec(oauth.Client.request)
|
||||
try:
|
||||
OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION.args
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue