[py3k] six.PY2
authorRémi Cardona <remi.cardona@logilab.fr>
Tue, 15 Sep 2015 17:28:05 +0200
changeset 10677 59ec0aaae08b
parent 10676 9d6b79081bad
child 10678 77333ec71fab
[py3k] six.PY2
server/sources/rql2sql.py
--- 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)