Issue #16116: Now uses corrected include and library paths when building C extensions in a venv.

This commit is contained in:
Vinay Sajip 2012-10-23 20:26:14 +01:00
parent e6e96eea51
commit e87acc1f38
2 changed files with 10 additions and 0 deletions

View File

@ -160,6 +160,11 @@ def finalize_options(self):
if isinstance(self.include_dirs, str):
self.include_dirs = self.include_dirs.split(os.pathsep)
# If in a virtualenv, add its include directory
# Issue 16116
if sys.exec_prefix != sys.base_exec_prefix:
self.include_dirs.append(os.path.join(sys.exec_prefix, 'include'))
# Put the Python "system" include dir at the end, so that
# any local include dirs take precedence.
self.include_dirs.append(py_include)
@ -190,6 +195,8 @@ def finalize_options(self):
# must be the *native* platform. But we don't really support
# cross-compiling via a binary install anyway, so we let it go.
self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
if sys.base_exec_prefix != sys.prefix: # Issue 16116
self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs'))
if self.debug:
self.build_temp = os.path.join(self.build_temp, "Debug")
else:

View File

@ -46,6 +46,9 @@ Core and Builtins
Library
-------
- Issue #16116: Fix include and library paths to be correctwhen building C
extensions in venvs.
- Issue #16245: Fix the value of a few entities in html.entities.html5.
- Issue #14398: Fix size truncation and overflow bugs in the bz2 module.