diff --git a/asyncpg/pool.py b/asyncpg/pool.py index 20a3234e..b592f03c 100644 --- a/asyncpg/pool.py +++ b/asyncpg/pool.py @@ -767,7 +767,7 @@ def __init__(self, pool, timeout): self.connection = None self.done = False - async def __aenter__(self): + async def __aenter__(self) -> connection.Connection: if self.connection is not None or self.done: raise exceptions.InterfaceError('a connection is already acquired') self.connection = await self.pool._acquire(self.timeout)