summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@master-shake.local>2006-02-08 19:03:47 -0800
committerRobey Pointer <robey@master-shake.local>2006-02-08 19:03:47 -0800
commit07dfbd58080009d81f7b07a231b50d9180ce5fcb (patch)
tree61037dd1add7ccadfffd4648acdcf38101794740
parent27ccd56af7c18c6cb3a796d05e3cab6d069afca0 (diff)
[project @ robey@master-shake.local-20060209030347-a7238bae41dad9d7]
doing a close() on Transport.__del__ is useless: because a Transport can't go away until all its Channels are collected, it will never make a difference. so don't do it, cuz __del__ is pretty hairy.
-rw-r--r--paramiko/transport.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index e65f61f0..4dd94488 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -298,9 +298,6 @@ class Transport (threading.Thread):
self.server_accept_cv = threading.Condition(self.lock)
self.subsystem_table = { }
- def __del__(self):
- self.close()
-
def __repr__(self):
"""
Returns a string representation of this object, for debugging.
@@ -551,13 +548,9 @@ class Transport (threading.Thread):
Close this session, and any open channels that are tied to it.
"""
self.active = False
- # 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
+ self.packetizer.close()
+ for chan in self.channels.values():
+ chan._unlink()
def get_remote_server_key(self):
"""