Skip to content

Commit d9be2a0

Browse files
committed
Allow equivalent distutils and sysconfig locations
1 parent e7b1722 commit d9be2a0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

news/9839.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix compatibility between distutils and sysconfig when the returned location is a symbolic link.

src/pip/_internal/locations/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import contextlib
12
import logging
23
import pathlib
34
import sys
@@ -45,6 +46,9 @@ def _default_base(*, user: bool) -> str:
4546
def _warn_if_mismatch(old: pathlib.Path, new: pathlib.Path, *, key: str) -> bool:
4647
if old == new:
4748
return False
49+
with contextlib.suppress(OSError):
50+
if old.samefile(new):
51+
return False
4852
issue_url = "https://github.com/pypa/pip/issues/9617"
4953
message = (
5054
"Value for %s does not match. Please report this to <%s>"

0 commit comments

Comments
 (0)