Skip to content

Commit 6606ae2

Browse files
committed
pythongh-108223: Refer to PEP 703 as Free Threading
Rename support.Py_GIL_DISABLED to support.FREE_THREADING.
1 parent d384813 commit 6606ae2

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

Doc/using/configure.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ General Options
292292
.. option:: --disable-gil
293293

294294
Enables **experimental** support for running Python without the
295-
:term:`global interpreter lock` (GIL).
295+
:term:`global interpreter lock` (GIL): free threading build.
296+
297+
Define the ``Py_GIL_DISABLED`` macro and add ``"t"`` to
298+
:data:`sys.abiflags`.
296299

297300
See :pep:`703` "Making the Global Interpreter Lock Optional in CPython".
298301

Lib/test/libregrtest/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def get_build_info():
291291

292292
# --disable-gil
293293
if sysconfig.get_config_var('Py_GIL_DISABLED'):
294-
build.append("nogil")
294+
build.append("freethreading")
295295

296296
if hasattr(sys, 'gettotalrefcount'):
297297
# --with-pydebug

Lib/test/support/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,8 @@ def check_cflags_pgo():
796796
return any(option in cflags_nodist for option in pgo_options)
797797

798798

799-
Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
800-
if Py_GIL_DISABLED:
799+
FREE_THREADING = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
800+
if FREE_THREADING:
801801
_header = 'PHBBInP'
802802
else:
803803
_header = 'nP'

Lib/test/test_capi/test_misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2854,7 +2854,7 @@ def testfunc(n, m):
28542854
self.assertIn("_FOR_ITER_TIER_TWO", uops)
28552855

28562856

2857-
@unittest.skipUnless(support.Py_GIL_DISABLED, 'need Py_GIL_DISABLED')
2857+
@unittest.skipUnless(support.FREE_THREADING, 'need free threading')
28582858
class TestPyThreadId(unittest.TestCase):
28592859
def test_py_thread_id(self):
28602860
# gh-112535: Test _Py_ThreadId(): make sure that thread identifiers

Lib/test/test_cppext/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
# gh-110119: pip does not currently support 't' in the ABI flag use by
1616
# --disable-gil builds. Once it does, we can remove this skip.
17-
@unittest.skipIf(support.Py_GIL_DISABLED,
18-
'test does not work with --disable-gil')
17+
@unittest.skipIf(support.FREE_THREADING,
18+
'test does not work with free threading')
1919
@support.requires_subprocess()
2020
class TestCPPExt(unittest.TestCase):
2121
@support.requires_resource('cpu')

Lib/test/test_importlib/test_windows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_module_not_found(self):
112112
class WindowsExtensionSuffixTests:
113113
def test_tagged_suffix(self):
114114
suffixes = self.machinery.EXTENSION_SUFFIXES
115-
abi_flags = "t" if support.Py_GIL_DISABLED else ""
115+
abi_flags = "t" if support.FREE_THREADING else ""
116116
ver = sys.version_info
117117
platform = re.sub('[^a-zA-Z0-9]', '_', get_platform())
118118
expected_tag = f".cp{ver.major}{ver.minor}{abi_flags}-{platform}.pyd"

Lib/test/test_sys.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ def test_pystats(self):
12241224
@test.support.cpython_only
12251225
@unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags')
12261226
def test_disable_gil_abi(self):
1227-
self.assertEqual('t' in sys.abiflags, support.Py_GIL_DISABLED)
1227+
self.assertEqual('t' in sys.abiflags, support.FREE_THREADING)
12281228

12291229

12301230
@test.support.cpython_only

0 commit comments

Comments
 (0)