Python 3 compatibility: remove long
For Python 3.0, long isn't supported already, it can be replaced with int. Change-Id: Ic8f961057d6f35fa436c8b0d9c18df404df92f2d Story: 2003433 Task: 26203 Signed-off-by: zhangyangyang <zhangyangyang@unionpay.com>
This commit is contained in:
parent
0426081c88
commit
594c5e5617
|
@ -52,7 +52,7 @@ _nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod,
|
|||
inspect.iscode, inspect.isbuiltin, inspect.isroutine,
|
||||
inspect.isabstract]
|
||||
|
||||
_simple_types = (types.NoneType, int, basestring, bool, float, long)
|
||||
_simple_types = (types.NoneType, six.integer_types, basestring, bool, float)
|
||||
|
||||
|
||||
def to_primitive(value, convert_instances=False, convert_datetime=True,
|
||||
|
@ -82,7 +82,6 @@ def to_primitive(value, convert_instances=False, convert_datetime=True,
|
|||
# 26164 <type 'list'>
|
||||
# 6491 <type 'float'>
|
||||
# 283 <type 'tuple'>
|
||||
# 19 <type 'long'>
|
||||
if isinstance(value, _simple_types):
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in New Issue