Skip to content

Commit 71271d5

Browse files
author
hauntsaninja
committed
add back in caching
1 parent d88a45c commit 71271d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/find_sources.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Routines for finding the sources that mypy will check"""
22

3+
import functools
34
import os.path
45

56
from typing import List, Sequence, Set, Tuple, Optional, Dict
@@ -140,6 +141,8 @@ def crawl_up(self, path: str) -> Tuple[str, str]:
140141

141142
return module, base_dir
142143

144+
# Add a cache in case many files are passed to mypy
145+
@functools.lru_cache()
143146
def crawl_up_dir(self, dir: str) -> Tuple[str, str]:
144147
"""Given a directory name, return the corresponding module name and base directory."""
145148
parent_dir, base = os.path.split(dir)

0 commit comments

Comments
 (0)