diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 84e1c047f92..eadc87a052c 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()