web/views/ajaxcontroller.py
changeset 10729 6ca54ea4ba4d
parent 10662 10942ed172de
child 10750 1166a47dad40
--- a/web/views/ajaxcontroller.py	Tue Sep 22 15:00:41 2015 +0200
+++ b/web/views/ajaxcontroller.py	Tue Sep 22 15:01:16 2015 +0200
@@ -66,6 +66,8 @@
 from warnings import warn
 from functools import partial
 
+from six import text_type
+
 from logilab.common.date import strptime
 from logilab.common.registry import yes
 from logilab.common.deprecation import deprecated
@@ -150,7 +152,7 @@
         if result is None:
             return ''
         # get unicode on @htmlize methods, encoded string on @jsonize methods
-        elif isinstance(result, unicode):
+        elif isinstance(result, text_type):
             return result.encode(self._cw.encoding)
         return result