From da9ef5e1ddd67db3c3710ac471437f700a973d7b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 21 Aug 2023 21:32:38 +0200 Subject: [PATCH] gh-108223: test.pythoninfo and libregrtest log Py_NOGIL Enable with --disable-gil --without-pydebug: $ make pythoninfo|grep NOGIL sysconfig[Py_NOGIL]: 1 $ ./python -m test ... == Python build: nogil debug ... --- Lib/test/libregrtest/utils.py | 5 +++++ Lib/test/pythoninfo.py | 1 + 2 files changed, 6 insertions(+) diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index fd46819fd903fe..89a149ec5d6b36 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -228,6 +228,11 @@ def get_build_info(): ldflags_nodist = sysconfig.get_config_var('PY_LDFLAGS_NODIST') or '' build = [] + + # --disable-gil + if sysconfig.get_config_var('Py_NOGIL'): + build.append("nogil") + if hasattr(sys, 'gettotalrefcount'): # --with-pydebug build.append('debug') diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index e4e098dd84cfb9..ad7d5291af42f3 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -492,6 +492,7 @@ def collect_sysconfig(info_add): 'PY_STDMODULE_CFLAGS', 'Py_DEBUG', 'Py_ENABLE_SHARED', + 'Py_NOGIL', 'SHELL', 'SOABI', 'prefix',