From 12efdd7ca121e7b7b6f810d1666cfbd9c5ea309a Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Wed, 8 Feb 2006 23:35:16 -0800 Subject: [PATCH] [project @ robey@master-shake.local-20060209073516-77f30d55aee054ea] packetizer doesn't need a __del__, and the keepalive should use a weakref --- paramiko/packet.py | 7 ------- paramiko/transport.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/paramiko/packet.py b/paramiko/packet.py index 1380899..7561649 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -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. diff --git a/paramiko/transport.py b/paramiko/transport.py index 4dd9448..ff3e239 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -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): """