Initial python3 changes

Mostly just updating libraries, removing string encoding/decoding,
fixing some edge cases. No new functionality was added in this
commit.
This commit is contained in:
rembo10
2022-01-14 10:38:03 +05:30
parent 9a7006ad14
commit ab4dd18be4
813 changed files with 146338 additions and 65753 deletions

View File

@@ -4,7 +4,7 @@
Example usage:
>>> from unidecode import unidecode:
>>> unidecode(u"\u5317\u4EB0")
>>> unidecode(u"\\u5317\\u4EB0")
"Bei Jing "
The transliteration uses a straightforward map, and doesn't have alternatives
@@ -22,11 +22,11 @@ Cache = {}
def unidecode(string):
"""Transliterate an Unicode object into an ASCII string
>>> unidecode(u"\u5317\u4EB0")
>>> unidecode(u"\\u5317\\u4EB0")
"Bei Jing "
"""
if version_info[0] < 3 and not isinstance(string, unicode):
if version_info[0] < 3 and not isinstance(string, str):
warnings.warn( "Argument %r is not an unicode object. "
"Passing an encoded string will likely have "
"unexpected results." % (type(string),),