[py3] changing unicode to str
authorjulien tayon <julien.tayon@logilab.fr>
Tue, 04 Jun 2019 09:35:47 +0200
changeset 12638 8466a6dd474e
parent 12637 234ca3cbbb46
child 12639 619210ba8b5e
[py3] changing unicode to str py2 support being dropped, passing the code in full py3 str/bytes syntax
cubicweb/web/schemaviewer.py
--- a/cubicweb/web/schemaviewer.py	Tue Jun 11 09:07:24 2019 +0200
+++ b/cubicweb/web/schemaviewer.py	Tue Jun 04 09:35:47 2019 +0200
@@ -42,7 +42,7 @@
             self._ = req._
         else:
             encoding = 'ascii'
-            self._ = unicode
+            self._ = str
         self.encoding = encoding
 
     # no self.req managements
@@ -239,6 +239,6 @@
 
     def to_string(self, value):
         """used to converte arbitrary values to encoded string"""
-        if isinstance(value, unicode):
+        if isinstance(value, str):
             return value.encode(self.encoding, 'replace')
         return str(value)