cubicweb/predicates.py
changeset 12567 26744ad37953
parent 12542 85194bd49119
--- a/cubicweb/predicates.py	Fri Apr 05 17:21:14 2019 +0200
+++ b/cubicweb/predicates.py	Fri Apr 05 17:58:19 2019 +0200
@@ -24,9 +24,6 @@
 from warnings import warn
 from operator import eq
 
-from six import string_types, integer_types
-from six.moves import range
-
 from logilab.common.registry import Predicate, objectify_predicate
 
 from yams.schema import BASE_TYPES, role_name
@@ -610,7 +607,7 @@
         super(is_instance, self).__init__(**kwargs)
         self.expected_etypes = expected_etypes
         for etype in self.expected_etypes:
-            assert isinstance(etype, string_types), etype
+            assert isinstance(etype, str), etype
 
     def __str__(self):
         return '%s(%s)' % (self.__class__.__name__,
@@ -670,7 +667,7 @@
             score = scorefunc(*args, **kwargs)
             if not score:
                 return 0
-            if isinstance(score, integer_types):
+            if isinstance(score, int):
                 return score
             return 1
         self.score_entity = intscore
@@ -1088,7 +1085,7 @@
 
     See :class:`cubicweb.entities.wfobjs.TrInfo` for more information.
     """
-    if isinstance(tr_names, string_types):
+    if isinstance(tr_names, str):
         tr_names = set((tr_names,))
     def match_etype_and_transition(trinfo):
         # take care trinfo.transition is None when calling change_state
@@ -1288,7 +1285,7 @@
             raise ValueError("match_form_params() can't be called with both "
                              "positional and named arguments")
         if expected:
-            if len(expected) == 1 and not isinstance(expected[0], string_types):
+            if len(expected) == 1 and not isinstance(expected[0], str):
                 raise ValueError("match_form_params() positional arguments "
                                  "must be strings")
             super(match_form_params, self).__init__(*expected)