From 3f8f68308f18a839ac9bef09571f09833d196f81 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 30 Dec 2008 13:58:12 +0100 Subject: [PATCH] Py3 test case fix --- tests/run/literalslice.pyx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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] -- 2.26.2