Skip to content

Commit 7b3d52a

Browse files
author
hauntsaninja
committed
actually inherit from FileSystemCache to appease mypyc
This means we could accidentally fallback to calling a FileSystemCache method if stuff gets moved around.
1 parent dec730a commit 7b3d52a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mypy/test/test_find_sources.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from mypy.modulefinder import BuildSource
22
import os
3-
from typing import Any, List, Optional, Set, Tuple, cast
3+
from typing import List, Optional, Set, Tuple
44
from unittest import TestCase
55
from mypy.find_sources import SourceFinder
6+
from mypy.fscache import FileSystemCache
67
from mypy.modulefinder import BuildSource
78
from mypy.options import Options
89

910

10-
class _FakeFSCache:
11+
class FakeFSCache(FileSystemCache):
1112
def __init__(self, files: Set[str]) -> None:
1213
assert all(os.path.isabs(f) for f in files)
1314
self.files = files
@@ -29,9 +30,6 @@ def init_under_package_root(self, file: str) -> bool:
2930
return False
3031

3132

32-
FakeFSCache = cast(Any, _FakeFSCache)
33-
34-
3533
def normalise_build_source_list(sources: List[BuildSource]) -> List[Tuple[str, Optional[str]]]:
3634
return sorted((s.module, s.base_dir) for s in sources)
3735

0 commit comments

Comments
 (0)