Skip to content
Snippets Groups Projects
Unverified Commit 2d5d01f2 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub
Browse files

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 4a31ed8a)

Co-authored-by: default avatarVictor Stinner <vstinner@python.org>
parent 502dba0c
Branches
Tags
No related merge requests found
...@@ -532,7 +532,10 @@ def format_attr(attr, value): ...@@ -532,7 +532,10 @@ def format_attr(attr, value):
def collect_socket(info_add): def collect_socket(info_add):
try:
import socket import socket
except ImportError:
return
hostname = socket.gethostname() hostname = socket.gethostname()
info_add('socket.hostname', hostname) info_add('socket.hostname', hostname)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment