Skip to content

Commit a333822

Browse files
Fix for windows.
1 parent 4d3d7f4 commit a333822

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

mypy/report.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,9 @@ def should_skip_path(path: str) -> bool:
141141

142142
def iterate_python_lines(path: str) -> Iterator[tuple[int, str]]:
143143
"""Return an iterator over (line number, line text) from a Python file."""
144-
try:
144+
if not os.path.isdir(path): # can happen with namespace packages
145145
with tokenize.open(path) as input_file:
146146
yield from enumerate(input_file, 1)
147-
except IsADirectoryError:
148-
# can happen with namespace packages
149-
pass
150147

151148

152149
class FuncCounterVisitor(TraverserVisitor):

0 commit comments

Comments
 (0)