Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mypy/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ def should_skip_path(path: str) -> bool:

def iterate_python_lines(path: str) -> Iterator[tuple[int, str]]:
"""Return an iterator over (line number, line text) from a Python file."""
with tokenize.open(path) as input_file:
yield from enumerate(input_file, 1)
try:
with tokenize.open(path) as input_file:
yield from enumerate(input_file, 1)
except IsADirectoryError:
# can happen with namespace packages
pass


class FuncCounterVisitor(TraverserVisitor):
Expand Down