[pypy-svn] r61183 - in pypy/trunk/pypy/objspace/std: . test
arigo at codespeak.net
arigo at codespeak.net
Wed Jan 21 14:03:48 CET 2009
Author: arigo
Date: Wed Jan 21 14:03:46 2009
New Revision: 61183
Modified:
pypy/trunk/pypy/objspace/std/test/test_typeobject.py
pypy/trunk/pypy/objspace/std/typeobject.py
Log:
Fix the repr of exceptions to say "type" instead of "class".
Modified: pypy/trunk/pypy/objspace/std/test/test_typeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/test/test_typeobject.py (original)
+++ pypy/trunk/pypy/objspace/std/test/test_typeobject.py Wed Jan 21 14:03:46 2009
@@ -704,6 +704,7 @@
assert repr(type(type)) == "<type 'type'>"
assert repr(complex) == "<type 'complex'>"
assert repr(property) == "<type 'property'>"
+ assert repr(TypeError) == "<type 'exceptions.TypeError'>"
def test_invalid_mro(self):
class A(object):
Modified: pypy/trunk/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/typeobject.py (original)
+++ pypy/trunk/pypy/objspace/std/typeobject.py Wed Jan 21 14:03:46 2009
@@ -592,7 +592,8 @@
mod = None
else:
mod = space.str_w(w_mod)
- if not w_obj.is_heaptype() or (mod is not None and mod == '__builtin__'):
+ if (not w_obj.is_heaptype() or
+ (mod == '__builtin__' or mod == 'exceptions')):
kind = 'type'
else:
kind = 'class'
More information about the Pypy-commit
mailing list