From: Victor Stinner Date: Wed, 25 May 2022 00:11:51 +0000 (+0200) Subject: test.pythoninfo no longer requires socket (#93191) X-Git-Tag: v3.12.0a1~1438 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a31ed8a32699973ae1f779022794fdab9fa08ee;p=thirdparty%2FPython%2Fcpython.git test.pythoninfo no longer requires socket (#93191) test.pythoninfo no longer fails if "import socket" fails: the socket module is now optional. --- diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 84e1c047f921..eadc87a052c4 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -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()