diff --git a/mypy/build.py b/mypy/build.py index 06d5ac3f72cf..e76ca2b1119a 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -494,6 +494,7 @@ def take_module_snapshot(module: types.ModuleType) -> str: (e.g. if there is a change in modules imported by a plugin). """ if hasattr(module, '__file__'): + assert module.__file__ is not None with open(module.__file__, 'rb') as f: digest = hash_digest(f.read()) else: