Skip to content

Commit b72afdf

Browse files
author
hauntsaninja
committed
add back in caching
1 parent 0cdd3f7 commit b72afdf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/find_sources.py

Lines changed: 3 additions & 0 deletions
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
@@ -144,6 +145,8 @@ def crawl_up(self, path: str) -> Tuple[str, str]:
144145

145146
return module, base_dir
146147

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

0 commit comments

Comments
 (0)