From 9ac91f61f2c70cdffd44d116ac89d29fae21d28a Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Sat, 21 Jan 2023 17:46:12 +0100 Subject: [PATCH] Fix condition for triggering warning on macOS bogus sysconfig --- src/pip/_internal/locations/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pip/_internal/locations/__init__.py b/src/pip/_internal/locations/__init__.py index 496844be142..ce5c1cf9db5 100644 --- a/src/pip/_internal/locations/__init__.py +++ b/src/pip/_internal/locations/__init__.py @@ -486,8 +486,9 @@ def _looks_like_apple_library(path: str) -> bool: def get_isolated_environment_lib_paths(prefix: str) -> List[str]: """Return the lib locations under ``prefix``.""" new_pure, new_plat = _sysconfig.get_isolated_environment_lib_paths(prefix) + new_lib_paths = _deduplicated(new_pure, new_plat) if _USE_SYSCONFIG: - return _deduplicated(new_pure, new_plat) + return new_lib_paths old_pure, old_plat = _distutils.get_isolated_environment_lib_paths(prefix) old_lib_paths = _deduplicated(old_pure, old_plat) @@ -497,7 +498,7 @@ def get_isolated_environment_lib_paths(prefix: str) -> List[str]: # cause serious build isolation bugs when Apple starts shipping 3.10 because # pip will install build backends to the wrong location. This tells users # who is at fault so Apple may notice it and fix the issue in time. - if all(_looks_like_apple_library(p) for p in old_lib_paths): + if all(_looks_like_apple_library(p) for p in new_lib_paths): deprecated( reason=( "Python distributed by Apple's Command Line Tools incorrectly "