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.
(cherry picked from commit 1ac2a83f30)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-08-13 11:11:49 -07:00 committed by GitHub
parent 853eecc769
commit ee98951252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1495,6 +1495,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