Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 5a155d4b7c86905afadb7fc370cc9d17f9cf4fd9 1 parent d6d8823
@hades hades authored ryanmcgrath committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  twython/twython.py
View
2  twython/twython.py
@@ -52,7 +52,7 @@
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.