summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2021-01-08 15:51:02 +0100
committerTomaz Solc <tomaz.solc@tablix.org>2021-01-08 15:51:02 +0100
commitbcf9fab37e5ebd5181dc0f5c9b5fcc359e49d21c (patch)
treea6ad40c2d8a3aa354d8f7e462e73a606f6ccaf35
parent21f7afdc8eac97c4279501306adf8b3f0ece4e40 (diff)
downloadunidecode-bcf9fab37e5ebd5181dc0f5c9b5fcc359e49d21c.tar.gz
Convert examples in README to Python 3 syntax.
-rw-r--r--README.rst6
-rw-r--r--tests/test_readme.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index 2537064..99ec5f6 100644
--- a/README.rst
+++ b/README.rst
@@ -57,11 +57,11 @@ string (Python 3.x) and returns a string (that can be encoded to ASCII bytes in
Python 3.x)::
>>> from unidecode import unidecode
- >>> unidecode(u'ko\u017eu\u0161\u010dek')
+ >>> unidecode('ko\u017eu\u0161\u010dek')
'kozuscek'
- >>> unidecode(u'30 \U0001d5c4\U0001d5c6/\U0001d5c1')
+ >>> unidecode('30 \U0001d5c4\U0001d5c6/\U0001d5c1')
'30 km/h'
- >>> unidecode(u"\u5317\u4EB0")
+ >>> unidecode('\u5317\u4EB0')
'Bei Jing '
You can also specify an *errors* argument to ``unidecode()`` that determines
diff --git a/tests/test_readme.py b/tests/test_readme.py
index dbf757f..a476b3c 100644
--- a/tests/test_readme.py
+++ b/tests/test_readme.py
@@ -2,7 +2,7 @@ import doctest
import sys
def additional_tests():
- if sys.version_info[0] < 3 and sys.maxunicode >= 0x10000:
+ if sys.version_info[0] >= 3 and sys.maxunicode >= 0x10000:
return doctest.DocFileSuite("../README.rst")
else:
return doctest.DocFileSuite()