patch from maxime ripard adding ip6 support.

This commit is contained in:
Robey Pointer 2009-04-14 18:55:25 -07:00
parent 7bd95eb0d0
commit 5e32b33be7
1 changed files with 4 additions and 1 deletions

View File

@ -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)