mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
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 4a31ed8a32)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
502dba0cf3
commit
2d5d01f26b
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue