test.pythoninfo no longer requires socket (GH-93191)

test.pythoninfo no longer fails if "import socket" fails: the socket
module is now optional.
(cherry picked from commit 4a31ed8a32)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2022-05-24 17:41:02 -07:00 committed by GitHub
parent a6ee7f99cc
commit 7a5f190c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -543,7 +543,10 @@ def collect_ssl(info_add):
def collect_socket(info_add):
import socket
try:
import socket
except ImportError:
return
try:
hostname = socket.gethostname()