summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-07-26 13:37:33 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-07-26 13:37:33 (GMT)
commit4eb5940a4d350d250ab4af08a8b5b6e553e1814d (patch)
treeb3d063c4d166a00f994bf64a80921553b15f1740 /Lib/httplib.py
parent2e441f7836134c475e35eea4a005f19699703a9b (diff)
downloadcpython-4eb5940a4d350d250ab4af08a8b5b6e553e1814d.zip
cpython-4eb5940a4d350d250ab4af08a8b5b6e553e1814d.tar.gz
cpython-4eb5940a4d350d250ab4af08a8b5b6e553e1814d.tar.bz2
Untabify IPv6 changes.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index d566b35..1038831 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -357,22 +357,22 @@ class HTTPConnection:
def connect(self):
"""Connect to the host and port specified in __init__."""
- for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
- af, socktype, proto, canonname, sa = res
- try:
- self.sock = socket.socket(af, socktype, proto)
- if self.debuglevel > 0:
- print "connect: (%s, %s)" % (self.host, self.port)
- self.sock.connect(sa)
- except socket.error, msg:
- if self.debuglevel > 0:
- print 'connect fail:', (self.host, self.port)
- self.sock.close()
- self.sock = None
- continue
- break
- if not self.sock:
- raise socket.error, msg
+ for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
+ af, socktype, proto, canonname, sa = res
+ try:
+ self.sock = socket.socket(af, socktype, proto)
+ if self.debuglevel > 0:
+ print "connect: (%s, %s)" % (self.host, self.port)
+ self.sock.connect(sa)
+ except socket.error, msg:
+ if self.debuglevel > 0:
+ print 'connect fail:', (self.host, self.port)
+ self.sock.close()
+ self.sock = None
+ continue
+ break
+ if not self.sock:
+ raise socket.error, msg
def close(self):
"""Close the connection to the HTTP server."""