Issue #16717: get rid of socket.error, replace with OSError

This commit is contained in:
Andrew Svetlov 2012-12-18 23:10:48 +02:00
parent ad28c7f9da
commit 0832af6628
39 changed files with 169 additions and 167 deletions

View file

@ -1130,8 +1130,9 @@ class Transport:
for i in (0, 1):
try:
return self.single_request(host, handler, request_body, verbose)
except socket.error as e:
if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED, errno.EPIPE):
except OSError as e:
if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED,
errno.EPIPE):
raise
except http.client.BadStatusLine: #close after we sent request
if i: