Merge pull request #207 from devdave/patch-1

Allow for long's as well as ints for request params
This commit is contained in:
Mike Helmick 2013-05-29 08:35:48 -07:00
commit f20afb0113
3 changed files with 5 additions and 2 deletions

View file

@ -39,3 +39,4 @@ Patches and Suggestions
- `Paul Solbach <https://github.com/hansenrum>`_, fixed requirement for oauth_verifier - `Paul Solbach <https://github.com/hansenrum>`_, fixed requirement for oauth_verifier
- `Greg Nofi <https://github.com/nofeet>`_, fixed using built-in Exception attributes for storing & retrieving error message - `Greg Nofi <https://github.com/nofeet>`_, fixed using built-in Exception attributes for storing & retrieving error message
- `Jonathan Vanasco <https://github.com/jvanasco>`_, Debugging support, error_code tracking, Twitter error API tracking, other fixes - `Jonathan Vanasco <https://github.com/jvanasco>`_, Debugging support, error_code tracking, Twitter error API tracking, other fixes
- `DevDave <https://github.com/devdave>`_, quick fix for longs with helper._transparent_params

View file

@ -22,6 +22,7 @@ if is_py2:
str = unicode str = unicode
basestring = basestring basestring = basestring
numeric_types = (int, long, float)
elif is_py3: elif is_py3:
@ -29,3 +30,4 @@ elif is_py3:
str = str str = str
basestring = (str, bytes) basestring = (str, bytes)
numeric_types = (int, float)

View file

@ -1,4 +1,4 @@
from .compat import basestring from .compat import basestring, numeric_types
def _transparent_params(_params): def _transparent_params(_params):
@ -12,7 +12,7 @@ def _transparent_params(_params):
params[k] = 'true' params[k] = 'true'
else: else:
params[k] = 'false' params[k] = 'false'
elif isinstance(v, basestring) or isinstance(v, int): elif isinstance(v, basestring) or isinstance(v, numeric_types):
params[k] = v params[k] = v
else: else:
continue continue