Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cffdd9

Browse files
committed
Closes #15367: Corrected computation of include locations for source builds on Windows. Thanks to Richard Oudkerk for the bug report and patch.
1 parent 048b063 commit 8cffdd9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/distutils/command/build_ext.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from distutils.core import Command
99
from distutils.errors import *
1010
from distutils.sysconfig import customize_compiler, get_python_version
11+
from distutils.sysconfig import get_config_h_filename
1112
from distutils.dep_util import newer_group
1213
from distutils.extension import Extension
1314
from distutils.util import get_platform
@@ -196,7 +197,10 @@ def finalize_options(self):
196197

197198
# Append the source distribution include and library directories,
198199
# this allows distutils on windows to work in the source tree
199-
self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
200+
self.include_dirs.append(os.path.dirname(get_config_h_filename()))
201+
_sys_home = getattr(sys, '_home', None)
202+
if _sys_home:
203+
self.library_dirs.append(_sys_home)
200204
if MSVC_VERSION >= 9:
201205
# Use the .lib files for the correct architecture
202206
if self.plat_name == 'win32':

0 commit comments

Comments
 (0)