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
2
setup.py
2
setup.py
|
|
@ -5,7 +5,7 @@ from setuptools import setup
|
|||
from setuptools import find_packages
|
||||
|
||||
__author__ = 'Ryan McGrath <ryan@venodesigns.net>'
|
||||
__version__ = '1.4'
|
||||
__version__ = '1.4.1'
|
||||
|
||||
setup(
|
||||
# Basic package information.
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"""
|
||||
|
||||
__author__ = "Ryan McGrath <ryan@venodesigns.net>"
|
||||
__version__ = "1.4"
|
||||
__version__ = "1.4.1"
|
||||
|
||||
import urllib.request, urllib.parse, urllib.error
|
||||
import urllib.request, urllib.error, urllib.parse
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue