Skip to content

Commit ad3d498

Browse files
authored
Merge pull request #9865 from uranusjr/sysconfig-message-improvement
Cache location calculation functions
2 parents f9710e9 + 6123570 commit ad3d498

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pip/_internal/locations/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import functools
12
import logging
23
import pathlib
34
import sys
@@ -43,6 +44,7 @@ def _default_base(*, user: bool) -> str:
4344
return base
4445

4546

47+
@functools.lru_cache(maxsize=None)
4648
def _warn_if_mismatch(old: pathlib.Path, new: pathlib.Path, *, key: str) -> bool:
4749
if old == new:
4850
return False
@@ -56,6 +58,7 @@ def _warn_if_mismatch(old: pathlib.Path, new: pathlib.Path, *, key: str) -> bool
5658
return True
5759

5860

61+
@functools.lru_cache(maxsize=None)
5962
def _log_context(
6063
*,
6164
user: bool = False,

0 commit comments

Comments
 (0)