Skip to content

Commit 0cb3cb8

Browse files
committed
Fix sysconfig
1 parent ed89fa4 commit 0cb3cb8

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Lib/sysconfig/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def get_config_h_filename():
457457
"""Return the path of pyconfig.h."""
458458
if _PYTHON_BUILD:
459459
if os.name == "nt":
460-
inc_dir = os.path.dirname(sys._base_executable)
460+
inc_dir = os.path.join(_PROJECT_BASE, 'PC')
461461
else:
462462
inc_dir = _PROJECT_BASE
463463
else:

Lib/test/test_sysconfig.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,10 @@ def test_srcdir(self):
531531
Python_h = os.path.join(srcdir, 'Include', 'Python.h')
532532
self.assertTrue(os.path.exists(Python_h), Python_h)
533533
# <srcdir>/PC/pyconfig.h.in always exists even if unused
534-
pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h.in')
535-
self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
536534
pyconfig_h_in = os.path.join(srcdir, 'pyconfig.h.in')
537535
self.assertTrue(os.path.exists(pyconfig_h_in), pyconfig_h_in)
538536
if os.name == 'nt':
539-
# <executable dir>/pyconfig.h exists on Windows in a build tree
540-
pyconfig_h = os.path.join(sys.executable, '..', 'pyconfig.h')
537+
pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h')
541538
self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
542539
elif os.name == 'posix':
543540
makefile_dir = os.path.dirname(sysconfig.get_makefile_filename())

0 commit comments

Comments
 (0)