- Issue #8447: Make distutils.sysconfig follow symlinks in the path to

the interpreter executable.  This fixes a failure of test_httpservers
  on OS X.
This commit is contained in:
Mark Dickinson 2010-08-03 21:18:06 +00:00
parent 1df21e7e03
commit 6f09ea8937
2 changed files with 9 additions and 4 deletions

View File

@ -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 # 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, # live in project/PCBuild9. If we're dealing with an x64 Windows build,
# it'll live in project/PCbuild/amd64. # 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(): if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir)) project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
# PC/VS7.1 # PC/VS7.1
@ -74,7 +74,7 @@ def get_python_inc(plat_specific=0, prefix=None):
if os.name == "posix": if os.name == "posix":
if python_build: if python_build:
buildir = os.path.dirname(sys.executable) buildir = os.path.dirname(os.path.realpath(sys.executable))
if plat_specific: if plat_specific:
# python.h is located in the buildir # python.h is located in the buildir
inc_dir = buildir inc_dir = buildir
@ -222,7 +222,8 @@ def get_config_h_filename():
def get_makefile_filename(): def get_makefile_filename():
"""Return full pathname of installed Makefile from the Python build.""" """Return full pathname of installed Makefile from the Python build."""
if 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) lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
return os.path.join(lib_dir, "config", "Makefile") return os.path.join(lib_dir, "config", "Makefile")
@ -459,7 +460,7 @@ def _init_nt():
g['SO'] = '.pyd' g['SO'] = '.pyd'
g['EXE'] = ".exe" g['EXE'] = ".exe"
g['VERSION'] = get_python_version().replace(".", "") 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 global _config_vars
_config_vars = g _config_vars = g

View File

@ -89,6 +89,10 @@ C-API
Library 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 #7092: Fix the DeprecationWarnings emitted by the standard library - Issue #7092: Fix the DeprecationWarnings emitted by the standard library
when using the -3 flag. Patch by Florent Xicluna. when using the -3 flag. Patch by Florent Xicluna.