Skip to content

Commit

Permalink
test.pythoninfo no longer requires socket (pythonGH-93191)
Browse files Browse the repository at this point in the history
test.pythoninfo no longer fails if "import socket" fails: the socket
module is now optional.
(cherry picked from commit 4a31ed8)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner authored May 25, 2022
1 parent a6ee7f9 commit 7a5f190
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/pythoninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ def format_attr(attr, value):


def collect_socket(info_add):
import socket
try:
import socket
except ImportError:
return

try:
hostname = socket.gethostname()
Expand Down

0 comments on commit 7a5f190

Please sign in to comment.