Skip to content

Commit 65672f3

Browse files
committed
Rename attributes
1 parent ae9b982 commit 65672f3

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Doc/library/sys.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ always available. Unless explicitly noted otherwise, all variables are read-only
1919
*pointer_bits* is the width of pointers in bits, as an integer, equivalent
2020
to ``8 * sizeof(void *)``, i.e. usually ``32`` or ``64``.
2121

22-
*Py_GIL_DISABLED* is a boolean indicating whether the interpreter was built
22+
*free_threaded* is a boolean indicating whether the interpreter was built
2323
with the GIL disabled, i.e. with the :option:`--disable-gil` option,
2424
aka free-threading.
2525

26-
*Py_DEBUG* is a boolean indicating whether the interpreter was built in
26+
*debug* is a boolean indicating whether the interpreter was built in
2727
:ref:`debug mode <debug-build>`, i.e. with the :option:`--with-pydebug` option.
2828

2929
.. versionadded:: next

Lib/test/test_sys.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,11 @@ def test_abi_info(self):
744744
self.assertEqual(len(info.__dict__), 3)
745745
pointer_bits = 64 if sys.maxsize > 2**32 else 32
746746
self.assertEqual(info.pointer_bits, pointer_bits)
747-
for flag in ["Py_GIL_DISABLED", "Py_DEBUG"]:
748-
self.assertEqual(getattr(info, flag, None),
747+
for attr, flag in [
748+
("free_threaded", "Py_GIL_DISABLED"),
749+
("debug", "Py_DEBUG"),
750+
]:
751+
self.assertEqual(getattr(info, attr, None),
749752
bool(sysconfig.get_config_var(flag)))
750753

751754
@unittest.skipUnless(support.is_emscripten, "only available on Emscripten")

Python/sysmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,7 +3260,7 @@ PyDoc_STR(
32603260
"\n\
32613261
Static objects:\n\
32623262
\n\
3263-
abi_info -- a named tuple with information about the ABI.\n\
3263+
abi_info -- Python ABI information.\n\
32643264
builtin_module_names -- tuple of module names built into this interpreter\n\
32653265
copyright -- copyright notice pertaining to this interpreter\n\
32663266
exec_prefix -- prefix used to find the machine-specific Python library\n\
@@ -3657,7 +3657,7 @@ make_abi_info(void)
36573657
#else
36583658
value = Py_False;
36593659
#endif
3660-
res = PyDict_SetItemString(abi_info, "Py_GIL_DISABLED", value);
3660+
res = PyDict_SetItemString(abi_info, "free_threaded", value);
36613661
if (res < 0) {
36623662
goto error;
36633663
}
@@ -3667,7 +3667,7 @@ make_abi_info(void)
36673667
#else
36683668
value = Py_False;
36693669
#endif
3670-
res = PyDict_SetItemString(abi_info, "Py_DEBUG", value);
3670+
res = PyDict_SetItemString(abi_info, "debug", value);
36713671
if (res < 0) {
36723672
goto error;
36733673
}

0 commit comments

Comments
 (0)