[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-79]

in Transport.__del__, don't try to clean up attributes that were never created
This commit is contained in:
Robey Pointer 2005-11-11 17:43:01 +00:00
parent 42867ded42
commit 7e95e2afc8
1 changed files with 7 additions and 4 deletions

View File

@ -502,9 +502,13 @@ class Transport (threading.Thread):
Close this session, and any open channels that are tied to it.
"""
self.active = False
self.packetizer.close()
for chan in self.channels.values():
chan._unlink()
# since this may be called from __del__, can't assume any attributes exist
try:
self.packetizer.close()
for chan in self.channels.values():
chan._unlink()
except AttributeError:
pass
def get_remote_server_key(self):
"""
@ -1576,7 +1580,6 @@ class Transport (threading.Thread):
# it's now okay to send data again (if this was a re-key)
if not self.packetizer.need_rekey():
self.in_kex = False
self._log(DEBUG, 'clear to send')
self.clear_to_send_lock.acquire()
try:
self.clear_to_send.set()