From 117a5caf806aae2ee1219b87ea44ba338efaac46 Mon Sep 17 00:00:00 2001
From: Stefan Behnel <scoder@users.berlios.de>
Date: Sat, 17 Jul 2010 16:35:09 +0200
Subject: [PATCH] test fix for Py<2.5

---
 tests/run/withstat.pyx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/run/withstat.pyx b/tests/run/withstat.pyx
index ff6eb5ec0..bea6437e3 100644
--- a/tests/run/withstat.pyx
+++ b/tests/run/withstat.pyx
@@ -1,8 +1,15 @@
 from __future__ import with_statement
 
+import sys
 
 def typename(t):
-    return u"<type '%s'>" % type(t).__name__
+    name = type(t).__name__
+    if sys.version_info < (2,5):
+        if name == 'classobj' and issubclass(t, MyException):
+            name = 'type'
+        elif name == 'instance' and isinstance(t, MyException):
+            name = 'MyException'
+    return u"<type '%s'>" % name
 
 class MyException(Exception):
     pass
-- 
2.30.9