diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index 56d2d6dc4ab5f12..349b7c0b8bc6096 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -292,7 +292,10 @@ General Options .. option:: --disable-gil Enables **experimental** support for running Python without the - :term:`global interpreter lock` (GIL). + :term:`global interpreter lock` (GIL): free threading build. + + Define the ``Py_GIL_DISABLED`` macro and add ``"t"`` to + :data:`sys.abiflags`. See :pep:`703` "Making the Global Interpreter Lock Optional in CPython". diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index d4972ce4a50d2a1..41d9d955705ae4f 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -291,7 +291,7 @@ def get_build_info(): # --disable-gil if sysconfig.get_config_var('Py_GIL_DISABLED'): - build.append("nogil") + build.append("freethreading") if hasattr(sys, 'gettotalrefcount'): # --with-pydebug diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index c22d73c231b46e4..1eea41f02b9176b 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -796,8 +796,8 @@ def check_cflags_pgo(): return any(option in cflags_nodist for option in pgo_options) -Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED')) -if Py_GIL_DISABLED: +FREE_THREADING = bool(sysconfig.get_config_var('Py_GIL_DISABLED')) +if FREE_THREADING: _header = 'PHBBInP' else: _header = 'nP' diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py index 3d86ae37190475e..543c23f90f09604 100644 --- a/Lib/test/test_capi/test_misc.py +++ b/Lib/test/test_capi/test_misc.py @@ -2854,7 +2854,7 @@ def testfunc(n, m): self.assertIn("_FOR_ITER_TIER_TWO", uops) -@unittest.skipUnless(support.Py_GIL_DISABLED, 'need Py_GIL_DISABLED') +@unittest.skipUnless(support.FREE_THREADING, 'need free threading') class TestPyThreadId(unittest.TestCase): def test_py_thread_id(self): # gh-112535: Test _Py_ThreadId(): make sure that thread identifiers diff --git a/Lib/test/test_cppext/__init__.py b/Lib/test/test_cppext/__init__.py index c6039bd17b06624..0f32c47452adfa4 100644 --- a/Lib/test/test_cppext/__init__.py +++ b/Lib/test/test_cppext/__init__.py @@ -14,8 +14,8 @@ # gh-110119: pip does not currently support 't' in the ABI flag use by # --disable-gil builds. Once it does, we can remove this skip. -@unittest.skipIf(support.Py_GIL_DISABLED, - 'test does not work with --disable-gil') +@unittest.skipIf(support.FREE_THREADING, + 'test does not work with free threading') @support.requires_subprocess() class TestCPPExt(unittest.TestCase): @support.requires_resource('cpu') diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py index 8a9a8fffcd10d49..d7bf0622703d6c1 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -112,7 +112,7 @@ def test_module_not_found(self): class WindowsExtensionSuffixTests: def test_tagged_suffix(self): suffixes = self.machinery.EXTENSION_SUFFIXES - abi_flags = "t" if support.Py_GIL_DISABLED else "" + abi_flags = "t" if support.FREE_THREADING else "" ver = sys.version_info platform = re.sub('[^a-zA-Z0-9]', '_', get_platform()) expected_tag = f".cp{ver.major}{ver.minor}{abi_flags}-{platform}.pyd" diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index db5ba16c4d97399..3d708611dffaa8d 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1224,7 +1224,7 @@ def test_pystats(self): @test.support.cpython_only @unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags') def test_disable_gil_abi(self): - self.assertEqual('t' in sys.abiflags, support.Py_GIL_DISABLED) + self.assertEqual('t' in sys.abiflags, support.FREE_THREADING) @test.support.cpython_only