mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
Fix the connection refused error part of issue 3419, use errno module instead of a static list of possible connection refused messages.
This commit is contained in:
parent
9fcd4b3d29
commit
5d35373706
1 changed files with 2 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import socket
|
import socket
|
||||||
|
import errno
|
||||||
import time
|
import time
|
||||||
import tempfile
|
import tempfile
|
||||||
import itertools
|
import itertools
|
||||||
|
|
@ -250,7 +251,7 @@ def SocketClient(address):
|
||||||
try:
|
try:
|
||||||
s.connect(address)
|
s.connect(address)
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
if e.args[0] != 10061: # 10061 => connection refused
|
if e.args[0] != errno.ECONNREFUSED: # connection refused
|
||||||
debug('failed to connect to address %s', address)
|
debug('failed to connect to address %s', address)
|
||||||
raise
|
raise
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue