cubicweb/rset.py
changeset 11868 d5181d7f1389
parent 11767 432f87a63057
child 11870 3a84a79c4ed5
--- a/cubicweb/rset.py	Thu Nov 24 15:39:52 2016 +0100
+++ b/cubicweb/rset.py	Thu Nov 24 16:32:14 2016 +0100
@@ -20,7 +20,7 @@
 
 from warnings import warn
 
-from six import PY3
+from six import PY3, text_type
 from six.moves import range
 
 from logilab.common import nullobject
@@ -375,11 +375,11 @@
             return rqlstr
         # sounds like we get encoded or unicode string due to a bug in as_string
         if not encoded:
-            if isinstance(rqlstr, unicode):
+            if isinstance(rqlstr, text_type):
                 return rqlstr
-            return unicode(rqlstr, encoding)
+            return text_type(rqlstr, encoding)
         else:
-            if isinstance(rqlstr, unicode):
+            if isinstance(rqlstr, text_type):
                 return rqlstr.encode(encoding)
             return rqlstr