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 committed 2018-09-27 16:11:18 +02:00
1 parent 964a9bdcec
commit ea396528b7
8 files changed
+21 -25

No files matched your search

+2 -2
View File
@@ -860,7 +860,7 @@ class RDN:
return len(self._avas)
def __getitem__(self, key):
if isinstance(key, six.integer_types):
if isinstance(key, int):
return self._get_ava(self._avas[key])
if isinstance(key, slice):
return [self._get_ava(ava) for ava in self._avas[key]]
@@ -1178,7 +1178,7 @@ class DN:
return len(self.rdns)
def __getitem__(self, key):
if isinstance(key, six.integer_types):
if isinstance(key, int):
return self._get_rdn(self.rdns[key])
if isinstance(key, slice):
cls = self.__class__