Python 2: accept both long and int for type=int (module options) (#53289)

* Added unit test
This commit is contained in:
Felix Fontein 2019-03-05 15:39:03 +01:00 committed by Sam Doran
parent 1112e1d0da
commit 07fcb60d55
3 changed files with 13 additions and 5 deletions

View file

@ -1864,7 +1864,7 @@ class AnsibleModule(object):
raise TypeError('%s cannot be converted to a bool' % type(value))
def _check_type_int(self, value):
if isinstance(value, int):
if isinstance(value, integer_types):
return value
if isinstance(value, string_types):