gh-111863: Rename term Py_NOGIL to Py_GIL_DISABLED in sysconfig (gh-112307)

This commit is contained in:
Donghee Na 2023-11-22 01:32:43 +00:00 committed by GitHub
parent 46500c42f0
commit 4fa376b005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -1209,8 +1209,8 @@ def test_pystats(self):
@unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags') @unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags')
def test_disable_gil_abi(self): def test_disable_gil_abi(self):
abi_threaded = 't' in sys.abiflags abi_threaded = 't' in sys.abiflags
py_nogil = (sysconfig.get_config_var('Py_GIL_DISABLED') == 1) py_gil_disabled = (sysconfig.get_config_var('Py_GIL_DISABLED') == 1)
self.assertEqual(py_nogil, abi_threaded) self.assertEqual(py_gil_disabled, abi_threaded)
@test.support.cpython_only @test.support.cpython_only

View file

@ -58,11 +58,11 @@ _sysconfig_config_vars_impl(PyObject *module)
#endif #endif
#ifdef Py_GIL_DISABLED #ifdef Py_GIL_DISABLED
PyObject *py_nogil = _PyLong_GetOne(); PyObject *py_gil_disabled = _PyLong_GetOne();
#else #else
PyObject *py_nogil = _PyLong_GetZero(); PyObject *py_gil_disabled = _PyLong_GetZero();
#endif #endif
if (PyDict_SetItemString(config, "Py_GIL_DISABLED", py_nogil) < 0) { if (PyDict_SetItemString(config, "Py_GIL_DISABLED", py_gil_disabled) < 0) {
Py_DECREF(config); Py_DECREF(config);
return NULL; return NULL;
} }