mypy
mypy copied to clipboard
Fix crash in dmypy when packages are removed during dmypy run
At our company we use mypy extensively on quite a large codebase. More often than not, after switching branches dmypy will crash, because it still expects an import of a package although the package is gone in the new branch.
I did not manage to write a unit test for this, but verified it on our codebase and it solved the issue.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅