summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-08-03 21:33:04 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-08-03 21:33:04 (GMT)
commit1f0f2785d9000e0120cca170208004ae0189dd3c (patch)
treea32ffd3e8f2f5aa89ead789de920ac379aa01972
parent4f06cbb888816bb82836251644a01ef6a41026bd (diff)
downloadcpython-1f0f2785d9000e0120cca170208004ae0189dd3c.zip
cpython-1f0f2785d9000e0120cca170208004ae0189dd3c.tar.gz
cpython-1f0f2785d9000e0120cca170208004ae0189dd3c.tar.bz2
Issue #8447: Make distutils.sysconfig follow symlinks in the path to
the interpreter executable. This fixes a failure of test_httpservers on OS X.
-rw-r--r--Lib/distutils/sysconfig.py9
-rw-r--r--Misc/NEWS4
2 files changed, 9 insertions, 4 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 0fbd541..9842d26 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -25,7 +25,7 @@ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
# Path to the base directory of the project. On Windows the binary may
# live in project/PCBuild9. If we're dealing with an x64 Windows build,
# it'll live in project/PCbuild/amd64.
-project_base = os.path.dirname(os.path.abspath(sys.executable))
+project_base = os.path.dirname(os.path.realpath(sys.executable))
if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
# PC/VS7.1
@@ -77,7 +77,7 @@ def get_python_inc(plat_specific=0, prefix=None):
# the build directory may not be the source directory, we
# must use "srcdir" from the makefile to find the "Include"
# directory.
- base = os.path.dirname(os.path.abspath(sys.executable))
+ base = os.path.dirname(os.path.realpath(sys.executable))
if plat_specific:
return base
else:
@@ -223,7 +223,8 @@ def get_config_h_filename():
def get_makefile_filename():
"""Return full pathname of installed Makefile from the Python build."""
if python_build:
- return os.path.join(os.path.dirname(sys.executable), "Makefile")
+ return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
+ "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
return os.path.join(lib_dir, "config", "Makefile")
@@ -442,7 +443,7 @@ def _init_nt():
g['SO'] = '.pyd'
g['EXE'] = ".exe"
g['VERSION'] = get_python_version().replace(".", "")
- g['BINDIR'] = os.path.dirname(os.path.abspath(sys.executable))
+ g['BINDIR'] = os.path.dirname(os.path.realpath(sys.executable))
global _config_vars
_config_vars = g
diff --git a/Misc/NEWS b/Misc/NEWS
index 74e5230..8e164a9 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -84,6 +84,10 @@ C-API
Library
-------
+- Issue #8447: Make distutils.sysconfig follow symlinks in the path to
+ the interpreter executable. This fixes a failure of test_httpservers
+ on OS X.
+
- Issue #7372: Fix pstats regression when stripping paths from profile
data generated with the profile module.