Skip to content

Commit

Permalink
pythongh-121275: Fix test_logging and test_smtplib with Python build …
Browse files Browse the repository at this point in the history
…withoud IPv6 support (python#121276)

Fix test_logging and test_smtplib with Python build withoud IPv6 support
  • Loading branch information
aisk authored Jul 25, 2024
1 parent 070f1e2 commit 3998554
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/test/support/smtpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3998554

Please sign in to comment.