Fix up integer type detection on python3 (#25985)

This commit is contained in:
Kassian Sun 2017-06-22 20:48:22 +08:00 committed by jctanner
parent 921bc0599b
commit de4a8b83df

View file

@ -89,7 +89,7 @@ EXAMPLES:
from __future__ import (absolute_import, division, print_function)
from __future__ import unicode_literals
from ansible.module_utils.six import string_types
from ansible.module_utils.six import string_types, integer_types
import datetime
__metaclass__ = type
@ -139,7 +139,7 @@ class LookupModule(LookupBase):
def convert_mongo_result_to_valid_json(self, result):
if result is None:
return result
if isinstance(result, (int, long, float, bool)):
if isinstance(result, integer_types + (float, bool)):
return result
if isinstance(result, string_types):
return result