Skip to content

Commit d76cb3e

Browse files
committed
Fix iterator element type extraction for yield from
1 parent f9354eb commit d76cb3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/checkexpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Expression type checker. This file is conceptually part of TypeChecker."""
22
from __future__ import annotations
3-
from mypy.types import Instance
3+
44
from mypy.types import Instance, get_proper_type
55

66
import enum
@@ -6281,7 +6281,7 @@ def visit_yield_from_expr(self, e: YieldFromExpr, allow_none_return: bool = Fals
62816281
if isinstance(iter_type_proper, Instance) and iter_type_proper.args:
62826282
actual_item_type = iter_type_proper.args[0]
62836283
else:
6284-
actual_item_type = self.chk.get_generator_yield_type(iter_type, False)
6284+
actual_item_type = self.chk.get_generator_yield_type(iter_type_proper, False)
62856285

62866286
self.chk.check_subtype(
62876287
actual_item_type,

0 commit comments

Comments
 (0)