diff --git a/src/pip/_internal/operations/install/wheel.py b/src/pip/_internal/operations/install/wheel.py index 1f5af208f54..6b19ebf52be 100644 --- a/src/pip/_internal/operations/install/wheel.py +++ b/src/pip/_internal/operations/install/wheel.py @@ -138,8 +138,8 @@ def message_about_scripts_not_on_PATH(scripts: Sequence[str]) -> Optional[str]: # Group scripts by the path they were installed in grouped_by_dir: Dict[str, Set[str]] = collections.defaultdict(set) for destfile in scripts: - parent_dir = os.path.dirname(destfile) - script_name = os.path.basename(destfile) + parent_dir = Path(destfile).parent.resolve() + script_name = Path(destfile).name grouped_by_dir[parent_dir].add(script_name) # We don't want to warn for directories that are on PATH. @@ -152,7 +152,7 @@ def message_about_scripts_not_on_PATH(scripts: Sequence[str]) -> Optional[str]: warn_for: Dict[str, Set[str]] = { parent_dir: scripts for parent_dir, scripts in grouped_by_dir.items() - if Path(parent_dir).resolve() not in not_warn_dirs + if parent_dir not in not_warn_dirs } if not warn_for: return None