From: Dag Sverre Seljebotn Date: Sun, 17 May 2009 07:02:23 +0000 (-0700) Subject: Py3 testcase fixes X-Git-Tag: 0.11.2.rc1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=49a62a9a469f6ba06608aaff261a7219f6a5d0fc;p=cython.git Py3 testcase fixes --- diff --git a/tests/run/buffmt.pyx b/tests/run/buffmt.pyx index 982c8b94..35f3b867 100644 --- a/tests/run/buffmt.pyx +++ b/tests/run/buffmt.pyx @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + # Tests buffer format string parsing. __test__ = {} @@ -39,7 +41,7 @@ cdef class MockBuffer: cdef object itemsize def __init__(self, format, itemsize): - self.format = format + self.format = unicode(format).encode(u"ASCII") self.itemsize = itemsize self.zero = 0 self.minusone = -1 @@ -232,7 +234,7 @@ def alignment_string(fmt, exc=None): try: buf = MockBuffer(fmt, sizeof(int)) except ValueError, e: - msg = e.message.replace("Big", "X").replace("Little", "X").replace("big", "X").replace("little", "X") + msg = unicode(e).replace("Big", "X").replace("Little", "X").replace("big", "X").replace("little", "X") if msg != exc: print msg print " is not equal to"