From 84827de79e2481e52f01c8e08d31e9ce7d3d4ee7 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 14 May 2008 21:18:38 +0200 Subject: [PATCH] docstrings can't have u'abc' literals in Py3 --- tests/run/unicodeliterals.pyx | 8 ++++++-- tests/run/unicodeliteralsdefault.pyx | 8 ++++++-- tests/run/unicodeliteralslatin1.pyx | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/run/unicodeliterals.pyx b/tests/run/unicodeliterals.pyx index 436f20ae..7c271b73 100644 --- a/tests/run/unicodeliterals.pyx +++ b/tests/run/unicodeliterals.pyx @@ -19,7 +19,7 @@ __doc__ = r""" u'S\xf8k ik\xfc\xd6\xe4abc' >>> null u'\x00' -""" + """ +""".decode("ASCII") + """ >>> len(sa) 3 >>> len(ua) @@ -38,7 +38,7 @@ __doc__ = r""" 12 >>> len(null) 1 -""" + u""" +""".decode("ASCII") + u""" >>> sa == 'abc' True >>> ua == u'abc' @@ -63,6 +63,10 @@ __doc__ = r""" True """ +import sys +if sys.version_info[0] >= 3: + __doc__ = __doc__.replace(u" u'", u" '") + sa = 'abc' ua = u'abc' diff --git a/tests/run/unicodeliteralsdefault.pyx b/tests/run/unicodeliteralsdefault.pyx index d0928d1f..7123ee32 100644 --- a/tests/run/unicodeliteralsdefault.pyx +++ b/tests/run/unicodeliteralsdefault.pyx @@ -25,7 +25,7 @@ __doc__ = r""" u'S\xf8k ik\xfc\xd6\xe4abc' >>> null u'\x00' -""" + """ +""".decode("ASCII") + """ >>> len(sa) 3 >>> len(ua) @@ -44,7 +44,7 @@ __doc__ = r""" 12 >>> len(null) 1 -""" + u""" +""".decode("ASCII") + u""" >>> sa == 'abc' True >>> ua == u'abc' @@ -69,6 +69,10 @@ __doc__ = r""" True """ +import sys +if sys.version_info[0] >= 3: + __doc__ = __doc__.replace(u" u'", u" '") + sa = 'abc' ua = u'abc' diff --git a/tests/run/unicodeliteralslatin1.pyx b/tests/run/unicodeliteralslatin1.pyx index b40c9ffc..2ab8a20a 100644 --- a/tests/run/unicodeliteralslatin1.pyx +++ b/tests/run/unicodeliteralslatin1.pyx @@ -19,7 +19,7 @@ __doc__ = r""" u'S\xf8k ik\xfc\xd6\xe4abc' >>> null u'\x00' -""" + """ +""".decode("ASCII") + """ >>> len(sa) 3 >>> len(ua) @@ -38,7 +38,7 @@ __doc__ = r""" 12 >>> len(null) 1 -""" + u""" +""".decode("ASCII") + u""" >>> sa == 'abc' True >>> ua == u'abc' @@ -63,6 +63,10 @@ __doc__ = r""" True """ +import sys +if sys.version_info[0] >= 3: + __doc__ = __doc__.replace(u" u'", u" '") + sa = 'abc' ua = u'abc' -- 2.26.2