diff --git a/CHANGES/7785.bugfix b/CHANGES/7785.bugfix new file mode 100644 index 00000000000..c24a5594c2f --- /dev/null +++ b/CHANGES/7785.bugfix @@ -0,0 +1 @@ +Fixed a rare `RuntimeError: await wasn't used with future` exception -- by :user:`stalkerg` diff --git a/aiohttp/client.py b/aiohttp/client.py index 549b8c52bfe..2c7dfa005a0 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -1108,8 +1108,8 @@ def __init__(self, coro: Coroutine["asyncio.Future[Any]", None, _RetType]) -> No def send(self, arg: None) -> "asyncio.Future[Any]": return self._coro.send(arg) - def throw(self, arg: BaseException) -> None: # type: ignore[override] - self._coro.throw(arg) # type: ignore[unused-awaitable] + def throw(self, *args: Any, **kwargs: Any) -> "asyncio.Future[Any]": + return self._coro.throw(*args, **kwargs) def close(self) -> None: return self._coro.close()