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,6 +273,9 @@ class SSHClient (object):
establishing an SSH session establishing an SSH session
@raise socket.error: if a socket error occurred while connecting @raise socket.error: if a socket error occurred while connecting
""" """
if len(hostname.split(':')) > 1:
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if timeout is not None: if timeout is not None:
try: try: