diff --git a/AUTHORS.rst b/AUTHORS.rst index 2db7027..e155804 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -39,3 +39,4 @@ Patches and Suggestions - `Paul Solbach `_, fixed requirement for oauth_verifier - `Greg Nofi `_, fixed using built-in Exception attributes for storing & retrieving error message - `Jonathan Vanasco `_, Debugging support, error_code tracking, Twitter error API tracking, other fixes +- `DevDave `_, quick fix for longs with helper._transparent_params diff --git a/twython/compat.py b/twython/compat.py index 79f9c2c..26af6e8 100644 --- a/twython/compat.py +++ b/twython/compat.py @@ -22,6 +22,7 @@ if is_py2: str = unicode basestring = basestring + numeric_types = (int, long, float) elif is_py3: @@ -29,3 +30,4 @@ elif is_py3: str = str basestring = (str, bytes) + numeric_types = (int, float) diff --git a/twython/helpers.py b/twython/helpers.py index 7b8275b..daa3370 100644 --- a/twython/helpers.py +++ b/twython/helpers.py @@ -1,4 +1,4 @@ -from .compat import basestring +from .compat import basestring, numeric_types def _transparent_params(_params): @@ -12,7 +12,7 @@ def _transparent_params(_params): params[k] = 'true' else: params[k] = 'false' - elif isinstance(v, basestring) or isinstance(v, int): + elif isinstance(v, basestring) or isinstance(v, numeric_types): params[k] = v else: continue