Catch socket.error exception in testprogram

This commit is contained in:
Ch3LL 2018-08-01 16:35:16 -04:00
parent 05f2d65de3
commit 3734b1ec89
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -598,7 +598,7 @@ class TestSaltProgram(six.with_metaclass(TestSaltProgramMeta, TestProgram)):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
connect = sock.bind(('localhost', port))
except OSError:
except (socket.error, OSError):
# these ports are already in use, use different ones
pub_port = 4606
ret_port = 4607