Skip to content

Commit 6fa64a6

Browse files
committed
Calculate header directories in one place
This was already happening in locations.distutils_scheme, we're just reusing the existing work instead of doing it again.
1 parent e03a71a commit 6fa64a6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/pip/_internal/req/req_install.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import os
99
import shutil
1010
import sys
11-
import sysconfig
1211
import zipfile
1312
from distutils.util import change_root
1413

@@ -896,12 +895,7 @@ def install(
896895
install_options = list(install_options) + \
897896
self.options.get('install_options', [])
898897

899-
header_dir = None # type: Optional[str]
900-
if running_under_virtualenv():
901-
py_ver_str = 'python' + sysconfig.get_python_version()
902-
header_dir = os.path.join(
903-
sys.prefix, 'include', 'site', py_ver_str, self.name
904-
)
898+
header_dir = scheme.headers
905899

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

0 commit comments

Comments
 (0)