Skip to content

Commit

Permalink
Calculate header directories in one place
Browse files Browse the repository at this point in the history
This was already happening in locations.distutils_scheme, we're just
reusing the existing work instead of doing it again.
  • Loading branch information
chrahunt committed Nov 7, 2019
1 parent e03a71a commit 6fa64a6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import os
import shutil
import sys
import sysconfig
import zipfile
from distutils.util import change_root

Expand Down Expand Up @@ -896,12 +895,7 @@ def install(
install_options = list(install_options) + \
self.options.get('install_options', [])

header_dir = None # type: Optional[str]
if running_under_virtualenv():
py_ver_str = 'python' + sysconfig.get_python_version()
header_dir = os.path.join(
sys.prefix, 'include', 'site', py_ver_str, self.name
)
header_dir = scheme.headers

with TempDirectory(kind="record") as temp_dir:
record_filename = os.path.join(temp_dir.path, 'install-record.txt')
Expand Down

0 comments on commit 6fa64a6

Please sign in to comment.