From: Stefan Behnel Date: Wed, 14 May 2008 19:18:38 +0000 (+0200) Subject: docstrings can't have u'abc' literals in Py3 X-Git-Tag: 0.9.8rc1~37^2~83 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=84827de79e2481e52f01c8e08d31e9ce7d3d4ee7;p=cython.git docstrings can't have u'abc' literals in Py3 --- 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'