mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Untabify IPv6 changes.
This commit is contained in:
parent
2e441f7836
commit
4eb5940a4d
5 changed files with 126 additions and 126 deletions
|
@ -136,18 +136,18 @@ class Telnet:
|
|||
port = TELNET_PORT
|
||||
self.host = host
|
||||
self.port = port
|
||||
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
|
||||
af, socktype, proto, canonname, sa = res
|
||||
try:
|
||||
self.sock = socket.socket(af, socktype, proto)
|
||||
self.sock.connect(sa)
|
||||
except socket.error, msg:
|
||||
self.sock.close()
|
||||
self.sock = None
|
||||
continue
|
||||
break
|
||||
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
|
||||
af, socktype, proto, canonname, sa = res
|
||||
try:
|
||||
self.sock = socket.socket(af, socktype, proto)
|
||||
self.sock.connect(sa)
|
||||
except socket.error, msg:
|
||||
self.sock.close()
|
||||
self.sock = None
|
||||
continue
|
||||
break
|
||||
if not self.sock:
|
||||
raise socket.error, msg
|
||||
raise socket.error, msg
|
||||
|
||||
def __del__(self):
|
||||
"""Destructor -- close the connection."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue