[py3] use text_type from six instead of unicode
authorSamuel Trégouët <samuel.tregouet@logilab.fr>
Wed, 27 Jun 2018 16:55:00 +0200
changeset 527 7a6265fa347a
parent 526 5f0002b20dbd
child 528 328718ff629e
[py3] use text_type from six instead of unicode
nazca/utils/normalize.py
--- a/nazca/utils/normalize.py	Wed Jun 27 16:36:00 2018 +0200
+++ b/nazca/utils/normalize.py	Wed Jun 27 16:55:00 2018 +0200
@@ -21,6 +21,8 @@
 from unicodedata import normalize as _uninormalize
 from functools import partial
 
+from six import text_type
+
 
 FRENCH_STOPWORDS = set([u'alors', u'au', u'aux', u'aucuns', u'aussi', u'autre', u'avant',
 u'avec', u'avoir', u'bon', u'car', u'ce', u'cela', u'ces', u'ceux', u'chaque',
@@ -81,7 +83,7 @@
         try:
             replacement = MANUAL_UNICODE_MAP[letter]
         except KeyError:
-            if isinstance(letter, unicode):
+            if isinstance(letter, text_type):
                 replacement = _uninormalize('NFKD', letter)[0]
             else:
                 replacement = letter