summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2012-07-16 17:30:03 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2012-07-16 17:30:03 (GMT)
commit8cffdd9ca26224f9a254b06589989e37692c8a24 (patch)
treed7ac3f3b5119e7fa2945ebf98009f6b1a16553da
parent048b06378079acd1e62501335b881f28e6c1a9c5 (diff)
downloadcpython-8cffdd9ca26224f9a254b06589989e37692c8a24.zip
cpython-8cffdd9ca26224f9a254b06589989e37692c8a24.tar.gz
cpython-8cffdd9ca26224f9a254b06589989e37692c8a24.tar.bz2
Closes #15367: Corrected computation of include locations for source builds on Windows. Thanks to Richard Oudkerk for the bug report and patch.
-rw-r--r--Lib/distutils/command/build_ext.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index ac37c13..f16e2f1 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -8,6 +8,7 @@ import sys, os, re
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler, get_python_version
+from distutils.sysconfig import get_config_h_filename
from distutils.dep_util import newer_group
from distutils.extension import Extension
from distutils.util import get_platform
@@ -196,7 +197,10 @@ class build_ext(Command):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
- self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
+ self.include_dirs.append(os.path.dirname(get_config_h_filename()))
+ _sys_home = getattr(sys, '_home', None)
+ if _sys_home:
+ self.library_dirs.append(_sys_home)
if MSVC_VERSION >= 9:
# Use the .lib files for the correct architecture
if self.plat_name == 'win32':