Kaydet (Commit) 5d353737 authored tarafından Jesse Noller's avatar Jesse Noller

Fix the connection refused error part of issue 3419, use errno module instead of…

Fix the connection refused error part of issue 3419, use errno module instead of a static list of possible connection refused messages.
üst 9fcd4b3d
......@@ -11,6 +11,7 @@ __all__ = [ 'Client', 'Listener', 'Pipe' ]
import os
import sys
import socket
import errno
import time
import tempfile
import itertools
......@@ -250,7 +251,7 @@ def SocketClient(address):
try:
s.connect(address)
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)
raise
time.sleep(0.01)
......
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