Py3 test case fix
authorStefan Behnel <scoder@users.berlios.de>
Tue, 30 Dec 2008 12:58:12 +0000 (13:58 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 30 Dec 2008 12:58:12 +0000 (13:58 +0100)
tests/run/literalslice.pyx

index 6b1ede72d8c82a2e7da712a292e43c6ae7b6af3d..d7102b6caa6e34f5614f91980a96bfaa1262caa8 100644 (file)
@@ -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]