We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a5da65 commit 78bf798Copy full SHA for 78bf798
mypy/report.py
@@ -172,11 +172,10 @@ def on_file(
172
) -> None:
173
# Count physical lines. This assumes the file's encoding is a
174
# superset of ASCII (or at least uses \n in its line endings).
175
- try:
+ if not os.path.isdir(tree.path): # can happen with namespace packages
176
with open(tree.path, "rb") as f:
177
physical_lines = len(f.readlines())
178
- except IsADirectoryError:
179
- # can happen with namespace packages
+ else:
180
physical_lines = 0
181
182
func_counter = FuncCounterVisitor()
0 commit comments