From 02fcce2ed53121594b0ec1a022ce851b019a7c0e Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Tue, 27 Jul 2021 09:27:26 +0800 Subject: [PATCH] Correctly ignore osx_framework_user mismatches The expected 'headers' path is generally: * distutils (old): $PREFIX/include/python3.8/$PROJECT * sysconfig (new): $PREFIX/include/$PROJECT So we should check whether the old value's parent is a pythonX.Y, and the new value's parent matches the old's second-level parent. --- src/pip/_internal/locations/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pip/_internal/locations/__init__.py b/src/pip/_internal/locations/__init__.py index ce94c160971..a18ade3f815 100644 --- a/src/pip/_internal/locations/__init__.py +++ b/src/pip/_internal/locations/__init__.py @@ -137,8 +137,8 @@ def get_scheme( user and is_osx_framework() and k == "headers" - and old_v.parent == new_v - and old_v.name.startswith("python") + and old_v.parent.parent == new_v.parent + and old_v.parent.name.startswith("python") ) if skip_osx_framework_user_special_case: continue