[py3] use six.string_types instead of basestring
authorSamuel Trégouët <samuel.tregouet@logilab.fr>
Thu, 16 Aug 2018 14:08:33 +0200
changeset 533 6c7a6b480b78
parent 530 c22b96297291
child 534 69350ebf0370
[py3] use six.string_types instead of basestring
nazca/utils/normalize.py
--- a/nazca/utils/normalize.py	Fri Aug 03 12:05:15 2018 +0200
+++ b/nazca/utils/normalize.py	Thu Aug 16 14:08:33 2018 +0200
@@ -21,7 +21,7 @@
 from unicodedata import normalize as _uninormalize
 from functools import partial
 
-from six import text_type
+from six import text_type, string_types
 
 
 FRENCH_STOPWORDS = set([u'alors', u'au', u'aux', u'aucuns', u'aussi', u'autre', u'avant',
@@ -105,7 +105,7 @@
         2) Set the sentence to lower case
         3) Remove punctuation
     """
-    if not isinstance(sentence, basestring):
+    if not isinstance(sentence, string_types):
         return sentence
 
     if lemmas: