From 1ac2a83f30312976502fda042db5ce18d10ceec2 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 13 Aug 2019 12:37:59 -0500 Subject: [PATCH] bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729) Add error number 113 EHOSTUNREACH to get_socket_conn_refused_errs() of test.support. --- Lib/test/support/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 00e734e7059..46d646fe5b7 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1497,6 +1497,9 @@ def get_socket_conn_refused_errs(): # bpo-31910: socket.create_connection() fails randomly # with EADDRNOTAVAIL on Travis CI errors.append(errno.EADDRNOTAVAIL) + if hasattr(errno, 'EHOSTUNREACH'): + # bpo-37583: The destination host cannot be reached + errors.append(errno.EHOSTUNREACH) if not IPV6_ENABLED: errors.append(errno.EAFNOSUPPORT) return errors