Skip to content

Commit 56726ab

Browse files
committed
Rename attributes
1 parent 41027a3 commit 56726ab

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

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
@@ -3268,7 +3268,7 @@ PyDoc_STR(
32683268
"\n\
32693269
Static objects:\n\
32703270
\n\
3271-
abi_info -- a named tuple with information about the ABI.\n\
3271+
abi_info -- Python ABI information.\n\
32723272
builtin_module_names -- tuple of module names built into this interpreter\n\
32733273
copyright -- copyright notice pertaining to this interpreter\n\
32743274
exec_prefix -- prefix used to find the machine-specific Python library\n\
@@ -3665,7 +3665,7 @@ make_abi_info(void)
36653665
#else
36663666
value = Py_False;
36673667
#endif
3668-
res = PyDict_SetItemString(abi_info, "Py_GIL_DISABLED", value);
3668+
res = PyDict_SetItemString(abi_info, "free_threaded", value);
36693669
if (res < 0) {
36703670
goto error;
36713671
}
@@ -3675,7 +3675,7 @@ make_abi_info(void)
36753675
#else
36763676
value = Py_False;
36773677
#endif
3678-
res = PyDict_SetItemString(abi_info, "Py_DEBUG", value);
3678+
res = PyDict_SetItemString(abi_info, "debug", value);
36793679
if (res < 0) {
36803680
goto error;
36813681
}

0 commit comments

Comments
 (0)