[pypy-commit] pypy missing-ndarray-attributes: never pass an RSocket class around, it is a mixin

mattip noreply at buildbot.pypy.org
Mon Feb 4 21:52:47 CET 2013


Author: mattip <matti.picus at gmail.com>
Branch: missing-ndarray-attributes
Changeset: r60873:e5ee474dc98a
Date: 2013-02-04 22:51 +0200
http://bitbucket.org/pypy/pypy/changeset/e5ee474dc98a/

Log:	never pass an RSocket class around, it is a mixin

diff --git a/rpython/rlib/rsocket.py b/rpython/rlib/rsocket.py
--- a/rpython/rlib/rsocket.py
+++ b/rpython/rlib/rsocket.py
@@ -704,14 +704,16 @@
         return err
 
     if hasattr(_c, 'dup'):
-        def dup(self, SocketClass=None):
-            if SocketClass is None:
-                SocketClass = RSocket
+        def dup(self, SocketClass):
+        #def dup(self, SocketClass=None):
+            #if SocketClass is None:
+            #    SocketClass = RSocket
+            # assert SocketClass is not None
             fd = _c.dup(self.fd)
             if fd < 0:
                 raise self.error_handler()
             return make_socket(fd, self.family, self.s_type, self.proto,
-                               SocketClass=SocketClass)
+                               SocketClass)
         
     def getpeername(self):
         """Return the address of the remote endpoint."""
@@ -954,7 +956,7 @@
 
 # ____________________________________________________________
 
-def make_socket(fd, family, s_type, proto, SocketClass=RSocket):
+def make_socket(fd, family, s_type, proto, SocketClass):
     result = instantiate(SocketClass)
     result.fd = fd
     result.family = family


More information about the pypy-commit mailing list