[schema] RQL queries are always unicode objects in python 3
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 14 Oct 2015 15:49:03 +0200
changeset 10791 22611236983d
parent 10790 117a6bbefbfd
child 10793 8316fdad9987
[schema] RQL queries are always unicode objects in python 3 fixes commit 42c5bd7286b7.
schema.py
--- a/schema.py	Tue Oct 13 16:12:37 2015 +0200
+++ b/schema.py	Wed Oct 14 15:49:03 2015 +0200
@@ -25,7 +25,7 @@
 from logging import getLogger
 from warnings import warn
 
-from six import text_type, string_types, add_metaclass
+from six import PY2, text_type, string_types, add_metaclass
 from six.moves import range
 
 from logilab.common import tempattr
@@ -146,7 +146,7 @@
     added/removed for instance)
     """
     union = parse(u'Any 1 WHERE %s' % rqlstring).as_string()
-    if isinstance(union, str):
+    if PY2 and isinstance(union, str):
         union = union.decode('utf-8')
     return union.split(' WHERE ', 1)[1]