server/sources/rql2sql.py
changeset 10677 59ec0aaae08b
parent 10669 155c29e0ed1c
child 11293 63c589e6b076
--- a/server/sources/rql2sql.py	Tue Sep 15 17:25:50 2015 +0200
+++ b/server/sources/rql2sql.py	Tue Sep 15 17:28:05 2015 +0200
@@ -51,6 +51,7 @@
 
 import threading
 
+from six import PY2
 from six.moves import range
 
 from logilab.database import FunctionDescr, SQL_FUNCTIONS_REGISTRY
@@ -1514,7 +1515,7 @@
                 return self._mapped_term(constant, '%%(%s)s' % value)[0]
             except KeyError:
                 _id = value
-                if isinstance(_id, unicode):
+                if PY2 and isinstance(_id, unicode):
                     _id = _id.encode()
         else:
             _id = str(id(constant)).replace('-', '', 1)