diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-10-23 19:27:43 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-10-23 19:27:43 (GMT) |
commit | 998b105c6853f8c354e57cb7ef2807d7cb7abd9b (patch) | |
tree | 98b6054f357ea2dbdca8eabf1752a9ea4b0c32da /Lib/distutils/command | |
parent | d2e90cd62ca3ca845b6c6f26b41c039bb268341d (diff) | |
parent | e87acc1f38652f90b4b63b9e79d17a4e5f2f74eb (diff) | |
download | cpython-998b105c6853f8c354e57cb7ef2807d7cb7abd9b.zip cpython-998b105c6853f8c354e57cb7ef2807d7cb7abd9b.tar.gz cpython-998b105c6853f8c354e57cb7ef2807d7cb7abd9b.tar.bz2 |
Closes #16116: Merged fix from 3.3.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 6b6a04e..f7c71b3 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -160,6 +160,11 @@ class build_ext(Command): 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 @@ class build_ext(Command): # 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: |