10000 test.pythoninfo no longer requires socket (#93191) · python/cpython@4a31ed8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a31ed8

Browse files
authored
test.pythoninfo no longer requires socket (#93191)
test.pythoninfo no longer fails if "import socket" fails: the socket module is now optional.
1 parent 32b7bcf commit 4a31ed8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/pythoninfo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,10 @@ def format_attr(attr, value):
543543

544544

545545
def collect_socket(info_add):
546-
import socket
546+
try:
547+
import socket
548+
except ImportError:
549+
return
547550

548551
try:
549552
hostname = socket.gethostname()

0 commit comments

Comments
 (0)
0