projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d77ed0a
)
test fix for Py<2.5
author
Stefan Behnel
<scoder@users.berlios.de>
Sat, 17 Jul 2010 14:35:09 +0000
(16:35 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sat, 17 Jul 2010 14:35:09 +0000
(16:35 +0200)
tests/run/withstat.pyx
patch
|
blob
|
history
diff --git
a/tests/run/withstat.pyx
b/tests/run/withstat.pyx
index ff6eb5ec0dd07eaa7511e420145934d109ca20f8..bea6437e37648d76e8bdade74571c0b4bfa06818 100644
(file)
--- 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