[pypy-svn] r39257 - pypy/dist/lib-python/modified-2.4.1

ac at codespeak.net ac at codespeak.net
Wed Feb 21 10:51:12 CET 2007


Author: ac
Date: Wed Feb 21 10:51:11 2007
New Revision: 39257

Modified:
   pypy/dist/lib-python/modified-2.4.1/socket.py
Log:
_fileobject needs to parttake in the recounting of the socket object.

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	Wed Feb 21 10:51:11 2007
@@ -144,6 +144,8 @@
         raise error(EBADF, 'Bad file descriptor')
     def _drop(self):
         pass
+    def _reuse(self):
+        pass
     send = recv = sendto = recvfrom = __getattr__ = _dummy
 
 class _socketobject(object):
@@ -188,6 +190,7 @@
 
         Return a regular file object corresponding to the socket.  The mode
         and bufsize arguments are as for the built-in open() function."""
+        self._sock._reuse()
         return _fileobject(self._sock, mode, bufsize)
 
     _s = ("def %s(self, *args): return self._sock.%s(*args)\n\n"
@@ -232,6 +235,7 @@
         try:
             if self._sock:
                 self.flush()
+                self._sock._drop()
         finally:
             self._sock = None
 



More information about the Pypy-commit mailing list