From: Tim Peters Date: Mon, 23 Dec 2002 16:26:15 +0000 (+0000) Subject: Backporting a small part of the socket.py changes from 2.3: get rid X-Git-Tag: v2.2.3c1~199 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7adc32ffa4215a398b38a6c38987d1fbf5a9ac05;p=thirdparty%2FPython%2Fcpython.git Backporting a small part of the socket.py changes from 2.3: get rid 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. --- diff --git a/Lib/socket.py b/Lib/socket.py index e298f51f1399..5fac123c986e 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -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