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