mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-121275: Fix test_logging and test_smtplib with Python build withoud IPv6 support (#121276)
Fix test_logging and test_smtplib with Python build withoud IPv6 support
This commit is contained in:
parent
070f1e2e5b
commit
3998554bb0
1 changed files with 2 additions and 1 deletions
|
|
@ -633,7 +633,8 @@ def __init__(self, localaddr, remoteaddr,
|
|||
" be set to True at the same time")
|
||||
asyncore.dispatcher.__init__(self, map=map)
|
||||
try:
|
||||
gai_results = socket.getaddrinfo(*localaddr,
|
||||
family = 0 if socket.has_ipv6 else socket.AF_INET
|
||||
gai_results = socket.getaddrinfo(*localaddr, family=family,
|
||||
type=socket.SOCK_STREAM)
|
||||
self.create_socket(gai_results[0][0], gai_results[0][1])
|
||||
# try to re-use a server port if possible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue