From 3c4a95e1501ad48c347832fa4f46ca2a81d18575 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 8 Aug 2008 07:35:34 +0200 Subject: [PATCH] Py3 test fixes --- tests/run/withstat.pyx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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(): -- 2.26.2