|
3 | 3 |
|
4 | 4 | import sys |
5 | 5 | from nameparser.util import u |
6 | | -from nameparser.util import text_type |
| 6 | +from nameparser.util import text_types |
7 | 7 | from nameparser.util import lc |
8 | 8 | from nameparser.util import log |
9 | 9 | from nameparser.config import CONSTANTS |
@@ -226,7 +226,7 @@ def nickname(self): |
226 | 226 | def _set_list(self, attr, value): |
227 | 227 | if isinstance(value, list): |
228 | 228 | val = value |
229 | | - elif isinstance(value, text_type): |
| 229 | + elif isinstance(value, text_types): |
230 | 230 | val = [value] |
231 | 231 | else: |
232 | 232 | raise TypeError("Can only assign strings and lists to name attributes. " |
@@ -378,7 +378,7 @@ def parse_full_name(self): |
378 | 378 | self.nickname_list = [] |
379 | 379 | self.unparsable = True |
380 | 380 |
|
381 | | - if not isinstance(self._full_name, text_type): |
| 381 | + if not isinstance(self._full_name, text_types): |
382 | 382 | self._full_name = u(self._full_name, self.ENCODING) |
383 | 383 |
|
384 | 384 | self.pre_process() |
@@ -524,7 +524,7 @@ def parse_pieces(self, parts, additional_parts_count=0): |
524 | 524 |
|
525 | 525 | tmp = [] |
526 | 526 | for part in parts: |
527 | | - if not isinstance(part, text_type): |
| 527 | + if not isinstance(part, text_types): |
528 | 528 | raise TypeError("Name parts must be strings. Got {0}".format(type(part))) |
529 | 529 | tmp += [x.strip(' ,') for x in part.split(' ')] |
530 | 530 | return self.join_on_conjunctions(tmp, additional_parts_count) |
|
0 commit comments