packetizer doesn't need a __del__, and the keepalive should use a weakref
This commit is contained in:
Robey Pointer 2006-02-08 23:35:16 -08:00
parent 07dfbd5808
commit 12efdd7ca1
2 changed files with 1 additions and 8 deletions

View File

@ -99,13 +99,6 @@ class Packetizer (object):
self.__keepalive_last = time.time()
self.__keepalive_callback = None
def __del__(self):
# this is not guaranteed to be called, but we should try.
try:
self.__socket.close()
except:
pass
def set_log(self, log):
"""
Set the python log object to use for logging.

View File

@ -727,7 +727,7 @@ class Transport (threading.Thread):
@since: fearow
"""
self.packetizer.set_keepalive(interval,
lambda x=self: x.global_request('keepalive@lag.net', wait=False))
lambda x=weakref.proxy(self): x.global_request('keepalive@lag.net', wait=False))
def global_request(self, kind, data=None, wait=True):
"""