[py3k] unicode → six.text_type
authorRémi Cardona <remi.cardona@logilab.fr>
Tue, 15 Sep 2015 17:04:04 +0200
changeset 10675 e0db937f5add
parent 10674 f0006bdd36e9
child 10676 9d6b79081bad
[py3k] unicode → six.text_type
devtools/testlib.py
entities/__init__.py
server/querier.py
--- a/devtools/testlib.py	Tue Sep 15 15:28:20 2015 +0200
+++ b/devtools/testlib.py	Tue Sep 15 17:04:04 2015 +0200
@@ -28,7 +28,7 @@
 from warnings import warn
 from itertools import chain
 
-from six import string_types
+from six import text_type, string_types
 from six.moves import range
 from six.moves.urllib.parse import urlparse, parse_qs, unquote as urlunquote
 
@@ -348,7 +348,7 @@
         been properly bootstrapped.
         """
         admincfg = config.default_admin_config
-        cls.admlogin = unicode(admincfg['login'])
+        cls.admlogin = text_type(admincfg['login'])
         cls.admpassword = admincfg['password']
         # uncomment the line below if you want rql queries to be logged
         #config.global_set_option('query-log-file',
--- a/entities/__init__.py	Tue Sep 15 15:28:20 2015 +0200
+++ b/entities/__init__.py	Tue Sep 15 17:04:04 2015 +0200
@@ -19,7 +19,7 @@
 
 __docformat__ = "restructuredtext en"
 
-from six import string_types
+from six import text_type, string_types
 
 from logilab.common.decorators import classproperty
 
@@ -36,7 +36,7 @@
     @classproperty
     def cw_etype(cls):
         """entity type as a unicode string"""
-        return unicode(cls.__regid__)
+        return text_type(cls.__regid__)
 
     @classmethod
     def cw_create_url(cls, req, **kwargs):
--- a/server/querier.py	Tue Sep 15 15:28:20 2015 +0200
+++ b/server/querier.py	Tue Sep 15 17:04:04 2015 +0200
@@ -24,7 +24,7 @@
 
 from itertools import repeat
 
-from six import string_types, integer_types
+from six import text_type, string_types, integer_types
 from six.moves import range
 
 from rql import RQLSyntaxError, CoercionError
@@ -512,7 +512,7 @@
     def parse(self, rql, annotate=False):
         """return a rql syntax tree for the given rql"""
         try:
-            return self._parse(unicode(rql), annotate=annotate)
+            return self._parse(text_type(rql), annotate=annotate)
         except UnicodeError:
             raise RQLSyntaxError(rql)