From 7b7ea3b3b0b9b80519c63448d566ae1bf093331a Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Thu, 8 Feb 2018 11:51:56 -0800 Subject: [PATCH] When loading from a fine-grained cache, use the real path, not the cached (#4555) The path in the cache file will be a full path possibly from some build machine, and so might not match what is actually on disk locally. This can cause changes to be missed in the initial run. --- mypy/dmypy_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/dmypy_server.py b/mypy/dmypy_server.py index 5428ad7969a0..4e3b47a68c18 100644 --- a/mypy/dmypy_server.py +++ b/mypy/dmypy_server.py @@ -281,7 +281,7 @@ def initialize_fine_grained(self, sources: List[mypy.build.BuildSource]) -> Dict for meta, mypyfile, type_map in manager.saved_cache.values(): if meta.mtime is None: continue self.fswatcher.set_file_data( - meta.path, + mypyfile.path, FileData(st_mtime=float(meta.mtime), st_size=meta.size, md5=meta.hash)) # Run an update