1
--- paramiko/transport.py~ Wed Dec 8 15:38:05 2010
2
+++ paramiko/transport.py Wed Dec 8 15:40:32 2010
3
@@ -285,15 +285,21 @@ class Transport (threading.Thread):
4
if type(sock) is tuple:
5
# connect to the given (host, port)
7
+ reason = 'No suitable address family'
8
for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM):
9
if socktype == socket.SOCK_STREAM:
13
+ sock = socket.socket(af, socket.SOCK_STREAM)
15
+ sock.connect((hostname, port))
16
+ except socket.error, e:
21
- raise SSHException('No suitable address family for %s' % hostname)
22
- sock = socket.socket(af, socket.SOCK_STREAM)
23
- sock.connect((hostname, port))
25
+ 'Unable to connect to %s: %s' % (hostname, reason))
26
# okay, normal socket-ish flow here...
27
threading.Thread.__init__(self)