From: Daniele Varrazzo Date: Fri, 6 Oct 2023 12:38:44 +0000 (+0200) Subject: style(pool): don't report too many decimals in timeout error message X-Git-Tag: pool-3.2.0~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=134703ab2056592d8f1e45e281e014cb38021ce8;p=thirdparty%2Fpsycopg.git style(pool): don't report too many decimals in timeout error message --- diff --git a/psycopg_pool/psycopg_pool/pool.py b/psycopg_pool/psycopg_pool/pool.py index aeafec87e..ff8c4706e 100644 --- a/psycopg_pool/psycopg_pool/pool.py +++ b/psycopg_pool/psycopg_pool/pool.py @@ -797,7 +797,7 @@ class WaitingClient(Generic[CT]): try: if not self._cond.wait(timeout): self.error = PoolTimeout( - f"couldn't get a connection after {timeout} sec" + f"couldn't get a connection after {timeout:.2f} sec" ) except BaseException as ex: self.error = ex diff --git a/psycopg_pool/psycopg_pool/pool_async.py b/psycopg_pool/psycopg_pool/pool_async.py index 6f1b5f514..57eddd0b9 100644 --- a/psycopg_pool/psycopg_pool/pool_async.py +++ b/psycopg_pool/psycopg_pool/pool_async.py @@ -725,7 +725,7 @@ class AsyncClient(Generic[ACT]): await asyncio.wait_for(self._cond.wait(), timeout) except asyncio.TimeoutError: self.error = PoolTimeout( - f"couldn't get a connection after {timeout} sec" + f"couldn't get a connection after {timeout:.2f} sec" ) except BaseException as ex: self.error = ex