summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@twitter.com>2009-04-14 18:55:25 -0700
committerRobey Pointer <robey@twitter.com>2009-04-14 18:55:25 -0700
commit5e32b33be79c858fd7bd2cda37242e81e71e0f79 (patch)
tree0b2a82e35c4cd700a6237e594d7ec87954108726
parent7bd95eb0d0f126087b3ae59654b2154d82476045 (diff)
patch from maxime ripard adding ip6 support.
-rw-r--r--paramiko/client.py5
1 files changed, 4 insertions, 1 deletions
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)