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): """