[pypy-svn] r77584 - pypy/branch/fast-forward/pypy/module/_io

afa at codespeak.net afa at codespeak.net
Mon Oct 4 20:02:10 CEST 2010


Author: afa
Date: Mon Oct  4 20:02:09 2010
New Revision: 77584

Modified:
   pypy/branch/fast-forward/pypy/module/_io/interp_io.py
Log:
more translation fixes


Modified: pypy/branch/fast-forward/pypy/module/_io/interp_io.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/_io/interp_io.py	(original)
+++ pypy/branch/fast-forward/pypy/module/_io/interp_io.py	Mon Oct  4 20:02:09 2010
@@ -1,5 +1,6 @@
-from pypy.interpreter.baseobjspace import ObjSpace, Wrappable
+from pypy.interpreter.baseobjspace import ObjSpace, Wrappable, W_Root
 from pypy.interpreter.typedef import TypeDef, interp_attrproperty
+from pypy.interpreter.gateway import interp2app, Arguments
 from pypy.module.exceptions.interp_exceptions import W_IOError
 
 DEFAULT_BUFFER_SIZE = 8192
@@ -10,14 +11,23 @@
         W_IOError.__init__(self, space)
         self.written = 0
 
+    def descr_new(space, w_subtype, __args__):
+        self = space.allocate_instance(W_BlockingIOError, w_subtype)
+        W_BlockingIOError.__init__(self, space)
+        return space.wrap(self)
+    descr_new.unwrap_spec = [ObjSpace, W_Root, Arguments]
+
     def descr_init(self, space, w_errno, w_strerror, written=0):
         W_IOError.descr_init(self, space, [w_errno, w_strerror])
         self.written = written
+    descr_init.unwrap_spec = ['self', ObjSpace, W_Root, W_Root, int]
 
 W_BlockingIOError.typedef = TypeDef(
     'BlockingIOError',
     __doc__ = ("Exception raised when I/O would block "
                "on a non-blocking I/O stream"),
+    __new__  = interp2app(W_BlockingIOError.descr_new.im_func),
+    __init__ = interp2app(W_BlockingIOError.descr_init),
     characters_written = interp_attrproperty('written', W_BlockingIOError),
     )
 



More information about the Pypy-commit mailing list