[pypy-svn] r34437 - in pypy/dist: lib-python/modified-2.4.1 pypy/module/rsocket

ac at codespeak.net ac at codespeak.net
Thu Nov 9 18:42:27 CET 2006


Author: ac
Date: Thu Nov  9 18:42:26 2006
New Revision: 34437

Modified:
   pypy/dist/lib-python/modified-2.4.1/socket.py
   pypy/dist/pypy/module/rsocket/interp_socket.py
Log:
Only simulate dup() and makefile() if _socket.socket doesn't have them

Modified: pypy/dist/lib-python/modified-2.4.1/socket.py
==============================================================================
--- pypy/dist/lib-python/modified-2.4.1/socket.py	(original)
+++ pypy/dist/lib-python/modified-2.4.1/socket.py	Thu Nov  9 18:42:26 2006
@@ -195,8 +195,8 @@
     for _m in _socketmethods:
         exec _s % (_m, _m, _m, _m)
     del _m, _s
-
-socket = SocketType = _socketobject
+if not hasattr(socket, 'dup'): # Simulate dup() and makefile()
+    socket = SocketType = _socketobject
 
 class _fileobject(object):
     """Faux file object attached to a socket 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	Thu Nov  9 18:42:26 2006
@@ -1,5 +1,5 @@
 from pypy.interpreter.baseobjspace import Wrappable
-from pypy.interpreter.typedef import TypeDef
+from pypy.interpreter.typedef import TypeDef, make_weakref_descr
 from pypy.interpreter.gateway import ObjSpace, W_Root, NoneNotWrapped
 from pypy.interpreter.gateway import interp2app
 from pypy.rlib.rsocket import RSocket, AF_INET, SOCK_STREAM
@@ -472,5 +472,6 @@
 
  [*] not available on all platforms!""",
     __new__ = descr_socket_new,
+    __weakref__ = make_weakref_descr(W_RSocket),
     ** socketmethods
     )



More information about the Pypy-commit mailing list