summaryrefslogtreecommitdiffstats
path: root/Lib/test/pythoninfo.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-05-19 10:43:16 (GMT)
committerGitHub <noreply@github.com>2022-05-19 10:43:16 (GMT)
commit137fd3d88aa46669f5717734e823f4c594ab2843 (patch)
treea527865e1f3729ef3d7c69a43d08072d8d837d9c /Lib/test/pythoninfo.py
parente48ac9c1003c3816198cbfb6132a995150f9b048 (diff)
downloadcpython-137fd3d88aa46669f5717734e823f4c594ab2843.zip
cpython-137fd3d88aa46669f5717734e823f4c594ab2843.tar.gz
cpython-137fd3d88aa46669f5717734e823f4c594ab2843.tar.bz2
gh-90473: Decrease recursion limit and skip tests on WASI (GH-92803)
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r--Lib/test/pythoninfo.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 28549a6..84e1c04 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -545,8 +545,14 @@ def collect_ssl(info_add):
def collect_socket(info_add):
import socket
- hostname = socket.gethostname()
- info_add('socket.hostname', hostname)
+ try:
+ hostname = socket.gethostname()
+ except OSError:
+ # WASI SDK 15.0 does not have gethostname(2).
+ if sys.platform != "wasi":
+ raise
+ else:
+ info_add('socket.hostname', hostname)
def collect_sqlite(info_add):