hooks/integrity.py
changeset 10689 49a62b8f6d43
parent 10666 7f6b5f023884
child 10893 351c82df25be
--- a/hooks/integrity.py	Wed Sep 16 13:57:21 2015 +0200
+++ b/hooks/integrity.py	Wed Sep 16 15:17:42 2015 +0200
@@ -24,6 +24,8 @@
 
 from threading import Lock
 
+from six import text_type
+
 from cubicweb import validation_error, neg_role
 from cubicweb.schema import (META_RTYPES, WORKFLOW_RTYPES,
                              RQLConstraint, RQLUniqueConstraint)
@@ -292,7 +294,7 @@
                     value = edited[attr]
                 except KeyError:
                     continue # no text to tidy
-                if isinstance(value, unicode): # filter out None and Binary
+                if isinstance(value, text_type): # filter out None and Binary
                     if getattr(entity, str(metaattr)) == 'text/html':
                         edited[attr] = soup2xhtml(value, self._cw.encoding)