[pypy-svn] r34358 - pypy/dist/pypy/module/rsocket

ac at codespeak.net ac at codespeak.net
Wed Nov 8 10:33:03 CET 2006


Author: ac
Date: Wed Nov  8 10:33:02 2006
New Revision: 34358

Modified:
   pypy/dist/pypy/module/rsocket/interp_socket.py
Log:
Convert exceptions from calls to addr.as_object().

Modified: pypy/dist/pypy/module/rsocket/interp_socket.py
==============================================================================
--- pypy/dist/pypy/module/rsocket/interp_socket.py	(original)
+++ pypy/dist/pypy/module/rsocket/interp_socket.py	Wed Nov  8 10:33:02 2006
@@ -22,9 +22,10 @@
                 sock, addr = self.accept(W_RSocket)
             finally:
                 if GIL is not None: GIL.acquire(True)
+            return space.newtuple([space.wrap(sock),
+                                   addr.as_object(space)])
         except SocketError, e:
             raise converted_error(space, e)
-        return space.newtuple([space.wrap(sock), addr.as_object(space)])
     accept_w.unwrap_spec = ['self', ObjSpace]
 
     def bind_w(self, space, w_addr):
@@ -113,9 +114,9 @@
         """
         try:
             addr = self.getpeername()
+            return addr.as_object(space)
         except SocketError, e:
             raise converted_error(space, e)
-        return addr.as_object(space)
     getpeername_w.unwrap_spec = ['self', ObjSpace]
 
     def getsockname_w(self, space):
@@ -126,9 +127,9 @@
         """
         try:
             addr = self.getsockname()
+            return addr.as_object(space)
         except SocketError, e:
             raise converted_error(space, e)
-        return addr.as_object(space)
     getsockname_w.unwrap_spec = ['self', ObjSpace]
 
     def getsockopt_w(self, space, level, optname, w_buflen=NoneNotWrapped):
@@ -216,9 +217,10 @@
                 data, addr = self.recvfrom(buffersize, flags)
             finally:
                 if GIL is not None: GIL.acquire(True)
+            return space.newtuple([space.wrap(data),
+                                   addr.as_object(space)])
         except SocketError, e:
             raise converted_error(space, e)
-        return space.newtuple([space.wrap(data), addr.as_object(space)])
     recvfrom_w.unwrap_spec = ['self', ObjSpace, int, int]
 
     def send_w(self, space, data, flags=0):



More information about the Pypy-commit mailing list