diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-04-30 12:15:12 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-04-30 12:15:12 (GMT) |
commit | a5cd18275e333cde162281e7919adfa415b42b07 (patch) | |
tree | 014aa52d3147643cbcaa6bd6f59130067beb9189 /Lib/distutils | |
parent | 01d149fc1f249f6dda24728c45cd89cf5ba99025 (diff) | |
download | cpython-a5cd18275e333cde162281e7919adfa415b42b07.zip cpython-a5cd18275e333cde162281e7919adfa415b42b07.tar.gz cpython-a5cd18275e333cde162281e7919adfa415b42b07.tar.bz2 |
Fixed #8577. distutils.sysconfig.get_python_inc() now differenciates buildir and srcdir
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/sysconfig.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 54ccec4..bb53315 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -71,15 +71,19 @@ def get_python_inc(plat_specific=0, prefix=None): """ if prefix is None: prefix = plat_specific and EXEC_PREFIX or PREFIX + if os.name == "posix": if python_build: - base = os.path.dirname(os.path.abspath(sys.executable)) + buildir = os.path.dirname(sys.executable) if plat_specific: - inc_dir = base + # python.h is located in the buildir + inc_dir = buildir else: - inc_dir = os.path.join(base, "Include") - if not os.path.exists(inc_dir): - inc_dir = os.path.join(os.path.dirname(base), "Include") + # the source dir is relative to the buildir + srcdir = os.path.abspath(os.path.join(buildir, + get_config_var('srcdir'))) + # Include is located in the srcdir + inc_dir = os.path.join(srcdir, "Include") return inc_dir return os.path.join(prefix, "include", "python" + get_python_version()) elif os.name == "nt": |