]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backporting a small part of the socket.py changes from 2.3: get rid
authorTim Peters <tim.peters@gmail.com>
Mon, 23 Dec 2002 16:26:15 +0000 (16:26 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 23 Dec 2002 16:26:15 +0000 (16:26 +0000)
of the socket wrapper __del__ method.  It isn't needed, and it prevents
cyclic structures containing socket objects (primarily on Windows, where
the wrapper is used) from getting garbage-collected.  People running
ZEO tests in Zope under Windows are acutely aware of this, as the
test driver prints an ever-growing gc.garbage list after each test.

Lib/socket.py

index e298f51f1399108f311f951251ec00200eb5f8df..5fac123c986e23a233de782eb1a29155bdf0b7b4 100644 (file)
@@ -140,9 +140,6 @@ class _socketobject:
         # Avoid referencing globals here
         self._sock = self.__class__._closedsocket()
 
-    def __del__(self):
-        self.close()
-
     def accept(self):
         sock, addr = self._sock.accept()
         return _socketobject(sock), addr