[Python-checkins] gh-108223: test.pythoninfo and libregrtest log Py_NOGIL (#108238)

vstinner webhook-mailer at python.org
Mon Aug 21 16:16:27 EDT 2023


https://github.com/python/cpython/commit/5afe0c17ca14df430736e549542a4b85e7e7c7ac
commit: 5afe0c17ca14df430736e549542a4b85e7e7c7ac
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2023-08-21T22:16:23+02:00
summary:

gh-108223: test.pythoninfo and libregrtest log Py_NOGIL (#108238)

Enable with --disable-gil --without-pydebug:

    $ make pythoninfo|grep NOGIL
    sysconfig[Py_NOGIL]: 1

    $ ./python -m test
    ...
    == Python build: nogil debug
    ...

files:
M Lib/test/libregrtest/utils.py
M Lib/test/pythoninfo.py

diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index fd46819fd903f..89a149ec5d6b3 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 e4e098dd84cfb..ad7d5291af42f 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',



More information about the Python-checkins mailing list