Skip to content

Commit

Permalink
add back in caching
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Oct 23, 2020
1 parent d88a45c commit 71271d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mypy/find_sources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Routines for finding the sources that mypy will check"""

import functools
import os.path

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

return module, base_dir

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

0 comments on commit 71271d5

Please sign in to comment.