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 4d3d7f4 commit a333822Copy full SHA for a333822
mypy/report.py
@@ -141,12 +141,9 @@ def should_skip_path(path: str) -> bool:
141
142
def iterate_python_lines(path: str) -> Iterator[tuple[int, str]]:
143
"""Return an iterator over (line number, line text) from a Python file."""
144
- try:
+ if not os.path.isdir(path): # can happen with namespace packages
145
with tokenize.open(path) as input_file:
146
yield from enumerate(input_file, 1)
147
- except IsADirectoryError:
148
- # can happen with namespace packages
149
- pass
150
151
152
class FuncCounterVisitor(TraverserVisitor):
0 commit comments