[3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966)

Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds.
This was usually the case already, but this change guarantees it in all circumstances.
This commit is contained in:
Steve Dower 2025-05-19 21:24:53 +01:00 committed by GitHub
parent 89b744a772
commit 7686c752b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 68 additions and 78 deletions

View file

@ -468,7 +468,7 @@ def get_config_h_filename():
"""Return the path of pyconfig.h."""
if _PYTHON_BUILD:
if os.name == "nt":
inc_dir = os.path.dirname(sys._base_executable)
inc_dir = os.path.join(_PROJECT_BASE, 'PC')
else:
inc_dir = _PROJECT_BASE
else:

View file

@ -531,13 +531,10 @@ def test_srcdir(self):
Python_h = os.path.join(srcdir, 'Include', 'Python.h')
self.assertTrue(os.path.exists(Python_h), Python_h)
# <srcdir>/PC/pyconfig.h.in always exists even if unused
pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h.in')
self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
pyconfig_h_in = os.path.join(srcdir, 'pyconfig.h.in')
self.assertTrue(os.path.exists(pyconfig_h_in), pyconfig_h_in)
if os.name == 'nt':
# <executable dir>/pyconfig.h exists on Windows in a build tree
pyconfig_h = os.path.join(sys.executable, '..', 'pyconfig.h')
pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h')
self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
elif os.name == 'posix':
makefile_dir = os.path.dirname(sysconfig.get_makefile_filename())