diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-05-25 00:41:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 00:41:02 (GMT) |
commit | 7a5f190c9fa7c6cbd334dfea9ae6032ac886dd89 (patch) | |
tree | c624027912efcdaf6f116b154f547bb5e787c4f5 /Lib/test/pythoninfo.py | |
parent | a6ee7f99cc3344e130383b7cf070723ff47ea99c (diff) | |
download | cpython-7a5f190c9fa7c6cbd334dfea9ae6032ac886dd89.zip cpython-7a5f190c9fa7c6cbd334dfea9ae6032ac886dd89.tar.gz cpython-7a5f190c9fa7c6cbd334dfea9ae6032ac886dd89.tar.bz2 |
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 4a31ed8a32699973ae1f779022794fdab9fa08ee)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r-- | Lib/test/pythoninfo.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 84e1c04..eadc87a 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() |