Skip to content

Commit f9076ed

Browse files
committed
Tweak some of the logic for pulling info from the metas
1 parent 8ce5312 commit f9076ed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mypy/dmypy_server.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,14 @@ def initialize_fine_grained(self, sources: List[mypy.build.BuildSource]) -> Dict
281281
# Pull times and hashes out of the saved_cache and stick them into
282282
# the fswatcher, so we pick up the changes.
283283
for state in self.fine_grained_manager.graph.values():
284+
# Only grab hashes from modules that came from the
285+
# cache. For modules that actually got parsed &
286+
# typechecked we rely on the data from the actual disk
287+
# cache, since we don't generate metas for those.
288+
assert state.tree is not None
289+
if not state.tree.is_cache_skeleton: continue
284290
meta = state.meta
285-
# If there isn't a meta, that means the current
286-
# version got checked in the initial build.
287-
if meta is None: continue
291+
assert meta is not None
288292
assert state.path is not None
289293
self.fswatcher.set_file_data(
290294
state.path,

0 commit comments

Comments
 (0)