diff options
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index b0bdb11d90..815f9adce6 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4804,14 +4804,7 @@ class NetworkConnectionNoServer(unittest.TestCase): # On Solaris, ENETUNREACH is returned in this circumstance instead # of ECONNREFUSED. So, if that errno exists, add it to our list of # expected errnos. - expected_errnos = [ errno.ECONNREFUSED, ] - if hasattr(errno, 'ENETUNREACH'): - expected_errnos.append(errno.ENETUNREACH) - if hasattr(errno, 'EADDRNOTAVAIL'): - # bpo-31910: socket.create_connection() fails randomly - # with EADDRNOTAVAIL on Travis CI - expected_errnos.append(errno.EADDRNOTAVAIL) - + expected_errnos = support.get_socket_conn_refused_errs() self.assertIn(cm.exception.errno, expected_errnos) def test_create_connection_timeout(self): |