[pypy-svn] r5074 - pypy/trunk/src/pypy/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Sat Jun 12 16:40:44 CEST 2004
Author: arigo
Date: Sat Jun 12 16:40:43 2004
New Revision: 5074
Modified:
pypy/trunk/src/pypy/objspace/std/objspace.py
Log:
Hack to replace the cpython-wrapped os.error with our own OSError at wrap
time.
Modified: pypy/trunk/src/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/objspace.py (original)
+++ pypy/trunk/src/pypy/objspace/std/objspace.py Sat Jun 12 16:40:43 2004
@@ -242,9 +242,13 @@
w_result = x.__spacebind__(self)
#print 'wrapping', x, '->', w_result
return w_result
+ # anything below this line is implicitly XXX'ed
SlotWrapperType = type(type(None).__repr__)
if isinstance(x, (types.FunctionType, types.BuiltinFunctionType, SlotWrapperType)):
return W_BuiltinFunctionObject(self, x)
+ if isinstance(x, type(Exception)) and issubclass(x, Exception):
+ if hasattr(self, 'w_' + x.__name__):
+ return getattr(self, 'w_' + x.__name__)
print "cpython wrapping %r" % (x,)
#if hasattr(x, '__bases__'):
# print "cpython wrapping a class %r (%s)" % (x, type(x))
More information about the Pypy-commit
mailing list