We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 936ceac commit d12d32cCopy full SHA for d12d32c
mypy/semanal.py
@@ -417,9 +417,7 @@ def visit_func_def(self, defn: FuncDef) -> None:
417
# A coroutine defined as `async def foo(...) -> T: ...`
418
# has external return type `Awaitable[T]`.
419
ret_type = self.named_type_or_none('typing.Awaitable', [defn.type.ret_type])
420
- if ret_type is None:
421
- # We are running tests.
422
- ret_type = self.named_type('typing_full.Awaitable', [defn.type.ret_type])
+ assert ret_type is not None, "Internal error: typing.Awaitable not found"
423
defn.type = defn.type.copy_modified(ret_type=ret_type)
424
self.errors.pop_function()
425
0 commit comments