[py3] Use six.text_type instead of unicode in wdoc views 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 28 Jun 2018 09:38:38 +0200
branch3.26
changeset 12329 d0bf06146782
parent 12326 034bca253b55
child 12330 6e620df7d4c3
[py3] Use six.text_type instead of unicode in wdoc views
cubicweb/web/views/wdoc.py
--- a/cubicweb/web/views/wdoc.py	Mon Jun 18 10:04:08 2018 +0200
+++ b/cubicweb/web/views/wdoc.py	Thu Jun 28 09:38:38 2018 +0200
@@ -26,6 +26,8 @@
 from bisect import bisect_right
 from datetime import date
 
+from six import text_type
+
 from logilab.common.changelog import ChangeLog
 from logilab.common.date import strptime, todate
 from logilab.common.registry import yes
@@ -98,9 +100,9 @@
     for title in node.findall('title'):
         title_lang = title.attrib['{http://www.w3.org/XML/1998/namespace}lang']
         if title_lang == lang:
-            return unicode(title.text)
+            return text_type(title.text)
         if title_lang == 'en':
-            fallback_title = unicode(title.text)
+            fallback_title = text_type(title.text)
     return fallback_title
 
 def subsections(node):