[py3k] unicode → six.text_type
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 16 Sep 2015 18:40:03 +0200
changeset 10697 c99130d18356
parent 10696 4ba4be5553cf
child 10698 bee7de3b4e55
[py3k] unicode → six.text_type
rqlrewrite.py
--- a/rqlrewrite.py	Wed Sep 16 17:22:41 2015 +0200
+++ b/rqlrewrite.py	Wed Sep 16 18:40:03 2015 +0200
@@ -22,7 +22,7 @@
 """
 __docformat__ = "restructuredtext en"
 
-from six import string_types
+from six import text_type, string_types
 
 from rql import nodes as n, stmts, TypeResolverException
 from rql.utils import common_parent
@@ -623,7 +623,7 @@
             while argname in self.kwargs:
                 argname = subselect.allocate_varname()
             subselect.add_constant_restriction(subselect.get_variable(self.u_varname),
-                                               'eid', unicode(argname), 'Substitute')
+                                               'eid', text_type(argname), 'Substitute')
             self.kwargs[argname] = self.session.user.eid
         add_types_restriction(self.schema, subselect, subselect,
                               solutions=self.solutions)
@@ -762,7 +762,7 @@
                 # insert "U eid %(u)s"
                 stmt.add_constant_restriction(
                     stmt.get_variable(self.u_varname),
-                    'eid', unicode(argname), 'Substitute')
+                    'eid', text_type(argname), 'Substitute')
                 self.kwargs[argname] = self.session.user.eid
             return self.u_varname
         key = (self.current_expr, self.varmap, vname)