Skip to content

Commit 2526608

Browse files
committed
Fix yield-from type mismatch in iterate_python_lines
1 parent 51fa9d0 commit 2526608

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

mypy/checkexpr.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
"""Expression type checker. This file is conceptually part of TypeChecker."""
22

33
from __future__ import annotations
4+
<<<<<<< HEAD
5+
=======
6+
7+
from mypy.types import Instance, get_proper_type
8+
>>>>>>> d76cb3e76 (Fix iterator element type extraction for yield from)
49

510
import enum
611
import itertools

mypy/report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ def iterate_python_lines(path: str) -> Iterator[tuple[int, str]]:
147147
"""Return an iterator over (line number, line text) from a Python file."""
148148
if not os.path.isdir(path): # can happen with namespace packages
149149
with tokenize.open(path) as input_file:
150-
yield from enumerate(input_file, 1)
150+
for item in enumerate(input_file, 1):
151+
yield item
151152

152153

153154
class FuncCounterVisitor(TraverserVisitor):

0 commit comments

Comments
 (0)