Skip to content

Commit bc5b919

Browse files
authored
Prepare for typeshed sync: __file__ could be None (#11598)
Typeshed now declares `__file__` as an optional type.
1 parent fbcb4a8 commit bc5b919

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mypy/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ def take_module_snapshot(module: types.ModuleType) -> str:
494494
(e.g. if there is a change in modules imported by a plugin).
495495
"""
496496
if hasattr(module, '__file__'):
497+
assert module.__file__ is not None
497498
with open(module.__file__, 'rb') as f:
498499
digest = hash_digest(f.read())
499500
else:

0 commit comments

Comments
 (0)