Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43535d9

Browse files
author
Kristján Valur Jónsson
committed
http://bugs.python.org/issue6267
Incorrect exception handling for xmlrpclient retry
1 parent c2b7188 commit 43535d9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/xmlrpc/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,11 +1138,11 @@ def request(self, host, handler, request_body, verbose=0):
11381138
for i in (0, 1):
11391139
try:
11401140
return self.single_request(host, handler, request_body, verbose)
1141-
except (socket.error, http.client.HTTPException) as e:
1142-
retry = (errno.ECONNRESET,
1143-
errno.ECONNABORTED,
1144-
http.client.BadStatusLine) #close after we sent request
1145-
if i or e[0] not in retry:
1141+
except socket.error as e:
1142+
if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED):
1143+
raise
1144+
except http.client.BadStatusLine: #close after we sent request
1145+
if i:
11461146
raise
11471147

11481148
def single_request(self, host, handler, request_body, verbose=0):

0 commit comments

Comments
 (0)