diff options
author | Robey Pointer <robey@twitter.com> | 2009-02-16 01:24:26 -0800 |
---|---|---|
committer | Robey Pointer <robey@twitter.com> | 2009-02-16 01:24:26 -0800 |
commit | 25417575ef795c36d2663c88fdedba5bfae5cc26 (patch) | |
tree | db5a55c7e63a9321e36cb7267891a4d049781092 | |
parent | 967b0011f0e61cd724fa5a9f020890073f9fd75a (diff) |
make the transport a daemon thread since python 1.6 doesn't call the atexit handler correctly any more. also allow unicode as a hostname.
-rw-r--r-- | paramiko/transport.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py index a18e05b0..cb3f54b4 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -266,7 +266,7 @@ class Transport (threading.Thread): @param sock: a socket or socket-like object to create the session over. @type sock: socket """ - if type(sock) is str: + if isinstance(sock, (str, unicode)): # convert "host:port" into (host, port) hl = sock.split(':', 1) if len(hl) == 1: @@ -280,6 +280,7 @@ class Transport (threading.Thread): sock.connect((hostname, port)) # okay, normal socket-ish flow here... threading.Thread.__init__(self) + self.setDaemon(True) self.randpool = randpool self.sock = sock # Python < 2.3 doesn't have the settimeout method - RogerB |