From aa0b6f0288e6a511b750f7fe8f49a0e321362105 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:36:49 +0100 Subject: [PATCH] Replace lru_cache with functools.cache (#18337) Python 3.9 added `functools.cache` which can replace `lru_cache(maxsize=None)`. https://docs.python.org/3/library/functools.html#functools.cache --- mypy/modulefinder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py index fdd89837002f..a5d28a30dea8 100644 --- a/mypy/modulefinder.py +++ b/mypy/modulefinder.py @@ -751,7 +751,7 @@ def default_lib_path( return path -@functools.lru_cache(maxsize=None) +@functools.cache def get_search_dirs(python_executable: str | None) -> tuple[list[str], list[str]]: """Find package directories for given python. Guaranteed to return absolute paths.