Kaydet (Commit) 92331d5e authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Fix py3k warnings in httplib

üst b844ef79
...@@ -706,8 +706,8 @@ class HTTPConnection: ...@@ -706,8 +706,8 @@ class HTTPConnection:
if code != 200: if code != 200:
self.close() self.close()
raise socket.error, "Tunnel connection failed: %d %s" % (code, raise socket.error("Tunnel connection failed: %d %s" % (code,
message.strip()) message.strip()))
while True: while True:
line = response.fp.readline() line = response.fp.readline()
if line == '\r\n': break if line == '\r\n': break
...@@ -757,7 +757,7 @@ class HTTPConnection: ...@@ -757,7 +757,7 @@ class HTTPConnection:
else: else:
self.sock.sendall(str) self.sock.sendall(str)
except socket.error, v: except socket.error, v:
if v[0] == 32: # Broken pipe if v.args[0] == 32: # Broken pipe
self.close() self.close()
raise raise
...@@ -929,7 +929,7 @@ class HTTPConnection: ...@@ -929,7 +929,7 @@ class HTTPConnection:
self._send_request(method, url, body, headers) self._send_request(method, url, body, headers)
except socket.error, v: except socket.error, v:
# trap 'Broken pipe' if we're allowed to automatically reconnect # trap 'Broken pipe' if we're allowed to automatically reconnect
if v[0] != 32 or not self.auto_open: if v.args[0] != 32 or not self.auto_open:
raise raise
# try one more time # try one more time
self._send_request(method, url, body, headers) self._send_request(method, url, body, headers)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment