From: Stefan Behnel Date: Tue, 30 Dec 2008 12:58:12 +0000 (+0100) Subject: Py3 test case fix X-Git-Tag: 0.11-beta~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f8f68308f18a839ac9bef09571f09833d196f81;p=cython.git Py3 test case fix --- diff --git a/tests/run/literalslice.pyx b/tests/run/literalslice.pyx index 6b1ede72..d7102b6c 100644 --- a/tests/run/literalslice.pyx +++ b/tests/run/literalslice.pyx @@ -23,14 +23,17 @@ __doc__ = u""" """ import sys -if sys.version_info[0] < 3: - __doc__ = __doc__.replace(" b'", " '") +IS_PY3 = sys.version_info[0] >= 3 +if IS_PY3: + __doc__ = __doc__.replace(u" u'", u" '") else: - __doc__ = __doc__.replace(" u'", " '") - + __doc__ = __doc__.replace(u" b'", u" '") def test_str(n): - return "abcd"[n] + if IS_PY3: + return bytes(["abcd"[n]]) + else: + return "abcd"[n] def test_unicode_ascii(n): return u"abcd"[n]