From 5e32b33be79c858fd7bd2cda37242e81e71e0f79 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 14 Apr 2009 18:55:25 -0700 Subject: patch from maxime ripard adding ip6 support. --- paramiko/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/paramiko/client.py b/paramiko/client.py index 7870ea9f..52038bc3 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -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) -- cgit v1.2.3