Py3: Replace six.integer_types with int

In Python 3, six.integer_types is (int,). In most places, the alias can
be simply replaced with int. In other places, it was possible to
simplify the code by unpacking the tuple.

See: https://pagure.io/freeipa/issue/7715
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Christian Heimes
2018-09-26 12:33:30 +02:00
parent 964a9bdcec
commit ea396528b7
8 changed files with 21 additions and 25 deletions

View File

@@ -909,8 +909,7 @@ class LDAPClient:
return b'TRUE'
else:
return b'FALSE'
elif isinstance(val, (unicode, six.integer_types, Decimal, DN,
Principal)):
elif isinstance(val, (unicode, int, Decimal, DN, Principal)):
return six.text_type(val).encode('utf-8')
elif isinstance(val, DNSName):
return val.to_text().encode('ascii')