Patch for Python 2.5; inspect.getargspec() doesn't return a named tuple pre-2.6, so catch on AttributeError and just check in the entire tuple. Increment to 1.4.1 and pushed to Pypi for the sake of 2.5 users.
This commit is contained in:
parent
8aee9932a5
commit
9f8c04b0f2
3 changed files with 9 additions and 4 deletions
|
|
@ -9,7 +9,7 @@
|
|||
"""
|
||||
|
||||
__author__ = "Ryan McGrath <ryan@venodesigns.net>"
|
||||
__version__ = "1.4"
|
||||
__version__ = "1.4.1"
|
||||
|
||||
import urllib
|
||||
import urllib2
|
||||
|
|
@ -48,7 +48,12 @@ except ImportError:
|
|||
raise Exception("Twython requires the simplejson library (or Python 2.6) to work. http://www.undefined.org/python/")
|
||||
|
||||
# Detect if oauth2 supports the callback_url argument to request
|
||||
OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in inspect.getargspec(oauth.Client.request).args
|
||||
OAUTH_CLIENT_INSPECTION = inspect.getargspec(oauth.Client.request)
|
||||
try:
|
||||
OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION.args
|
||||
except AttributeError:
|
||||
# Python 2.5 doesn't return named tuples, so don't look for an args section specifically.
|
||||
OAUTH_LIB_SUPPORTS_CALLBACK = 'callback_url' in OAUTH_CLIENT_INSPECTION
|
||||
|
||||
class TwythonError(AttributeError):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue