make test for new style exceptions run on all Python versions by not actually testing...
authorStefan Behnel <scoder@users.berlios.de>
Fri, 2 May 2008 07:08:08 +0000 (09:08 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 2 May 2008 07:08:08 +0000 (09:08 +0200)
tests/run/new_style_exceptions.pyx

index 34c8bd6621dfa81e7f06b0414d4105b5ab4329e8..4dfcf375bb26d25e1da8a79612fea2bb9bf4746c 100644 (file)
@@ -1,15 +1,15 @@
 __doc__ = """
     >>> test(Exception('hi'))
     Raising: Exception('hi',)
-    Caught: <type 'exceptions.Exception'> Exception('hi',)
+    Caught: Exception('hi',)
 """
 
 import sys
 
 def test(obj):
-    print "Raising:", repr(obj)
+    print "Raising: %s%r" % (obj.__class__.__name__, obj.args)
     try:
         raise obj
     except:
         info = sys.exc_info()
-        print "Caught: %r %r" % (info[0], info[1])
+        print "Caught: %s%r" % (obj.__class__.__name__, obj.args)