Skip to content

Commit 6da7ebb

Browse files
authored
Merge pull request #220 from zooba/issue-219
#219 Use sysconfig.get_config_h_filename() to locate pyconfig.h
2 parents ee021a1 + fbe8abe commit 6da7ebb

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

distutils/sysconfig.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,11 @@ def _get_python_inc_posix_prefix(prefix):
195195

196196
def _get_python_inc_nt(prefix, spec_prefix, plat_specific):
197197
if python_build:
198-
# Include both the include and PC dir to ensure we can find
199-
# pyconfig.h
198+
# Include both include dirs to ensure we can find pyconfig.h
200199
return (
201200
os.path.join(prefix, "include")
202201
+ os.path.pathsep
203-
+ os.path.join(prefix, "PC")
202+
+ os.path.dirname(sysconfig.get_config_h_filename())
204203
)
205204
return os.path.join(prefix, "include")
206205

@@ -361,14 +360,7 @@ def customize_compiler(compiler): # noqa: C901
361360

362361
def get_config_h_filename():
363362
"""Return full pathname of installed pyconfig.h file."""
364-
if python_build:
365-
if os.name == "nt":
366-
inc_dir = os.path.join(_sys_home or project_base, "PC")
367-
else:
368-
inc_dir = _sys_home or project_base
369-
return os.path.join(inc_dir, 'pyconfig.h')
370-
else:
371-
return sysconfig.get_config_h_filename()
363+
return sysconfig.get_config_h_filename()
372364

373365

374366
def get_makefile_filename():

0 commit comments

Comments
 (0)