patch from maxime ripard adding ip6 support.
This commit is contained in:
parent
7bd95eb0d0
commit
5e32b33be7
|
@ -273,7 +273,10 @@ class SSHClient (object):
|
|||
establishing an SSH session
|
||||
@raise socket.error: if a socket error occurred while connecting
|
||||
"""
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
if len(hostname.split(':')) > 1:
|
||||
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
||||
else:
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
if timeout is not None:
|
||||
try:
|
||||
sock.settimeout(timeout)
|
||||
|
|
Loading…
Reference in New Issue