Skip to content

Commit 169f803

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 620a0e4 commit 169f803

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mypy/checkexpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,7 +6181,7 @@ def visit_await_expr(self, e: AwaitExpr, allow_none_return: bool = False) -> Typ
61816181
expected_type = self.type_context[-1]
61826182
if expected_type is not None:
61836183
expected_type = self.chk.named_generic_type("typing.Awaitable", [expected_type])
6184-
6184+
61856185
# For async function calls, don't propagate the expected type to avoid
61866186
# incorrect type inference affecting argument types
61876187
if isinstance(e.expr, CallExpr):
@@ -6190,7 +6190,7 @@ def visit_await_expr(self, e: AwaitExpr, allow_none_return: bool = False) -> Typ
61906190
actual_type = get_proper_type(self.accept(e.expr, None))
61916191
else:
61926192
actual_type = get_proper_type(self.accept(e.expr, expected_type))
6193-
6193+
61946194
if isinstance(actual_type, AnyType):
61956195
return AnyType(TypeOfAny.from_another_any, source_any=actual_type)
61966196
ret = self.check_awaitable_expr(

test-data/unit/check-async-await.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ async def test_await() -> str:
10941094
async def test_nested_await() -> str:
10951095
def inner() -> int:
10961096
return 123
1097-
1097+
10981098
# The await should not affect type inference of inner function call
10991099
value = inner()
11001100
result = await func(value)

0 commit comments

Comments
 (0)