Skip to content

Commit

Permalink
Fix mypy daemon crash when following from a new module (#10030)
Browse files Browse the repository at this point in the history
File watcher state for files added to the build wasn't updated
correctly, resulting in crashes.

I couldn't find a way to reproduce this in our test environment,
so I only tested this manually.

Fixes #10029.
  • Loading branch information
JukkaL authored Feb 5, 2021
1 parent 38bad9c commit 82dd59e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mypy/dmypy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,12 @@ def refresh_file(module: str, path: str) -> List[str]:

fix_module_deps(graph)

# Store current file state as side effect
self.fswatcher.find_changed()

self.previous_sources = find_all_sources_in_build(graph)
self.update_sources(self.previous_sources)

# Store current file state as side effect
self.fswatcher.find_changed()

t5 = time.time()

manager.log("fine-grained increment: update: {:.3f}s".format(t5 - t1))
Expand Down

0 comments on commit 82dd59e

Please sign in to comment.