Fixes an issue in the 1.4.5 point release, first pointed out by @michaelhelmick, fixed thanks to "tatz_tsuchiya".

This commit is contained in:
Ryan McGrath 2012-01-15 13:59:28 -05:00
parent ae5e63150b
commit fcbc702ae5

View file

@ -176,8 +176,10 @@ class Twython(object):
# If they don't do authentication, but still want to request unprotected resources, we need an opener.
self.client = httplib2.Http(**client_args)
# register available funcs to allow listing name when debugging.
def setFunc(key):
return lambda **kwargs: self._constructFunc(key, **kwargs)
for key in api_table.keys():
self.__dict__[key] = lambda **kwargs: self._constructFunc(key, **kwargs)
self.__dict__[key] = setFunc(key)
def _constructFunc(self, api_call, **kwargs):
# Go through and replace any mustaches that are in our API url.
@ -503,4 +505,4 @@ class Twython(object):
def encode(text):
if isinstance(text, (str,unicode)):
return Twython.unicode2utf8(text)
return str(text)
return str(text)