From: Stefan Behnel Date: Fri, 8 Aug 2008 05:35:34 +0000 (+0200) Subject: Py3 test fixes X-Git-Tag: 0.9.8.1~81^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3c4a95e1501ad48c347832fa4f46ca2a81d18575;p=cython.git Py3 test fixes --- diff --git a/tests/run/withstat.pyx b/tests/run/withstat.pyx index 4d08c9f2..bb407af8 100644 --- a/tests/run/withstat.pyx +++ b/tests/run/withstat.pyx @@ -12,12 +12,12 @@ exit >>> with_exception(None) enter value -exit +exit outer except >>> with_exception(True) enter value -exit +exit >>> multitarget() enter 1 2 3 4 5 @@ -32,20 +32,23 @@ enter exit """ +def typename(t): + return u"" % type(t).__name__ + class MyException(Exception): pass -class ContextManager: +class ContextManager(object): def __init__(self, value, exit_ret = None): self.value = value self.exit_ret = exit_ret def __exit__(self, a, b, tb): - print "exit", type(a), type(b), type(tb) + print u"exit", typename(a), typename(b), typename(tb) return self.exit_ret def __enter__(self): - print "enter" + print u"enter" return self.value def no_as():