From: Daniele Varrazzo Date: Sat, 10 Jul 2021 13:09:22 +0000 (+0200) Subject: Don't chain exceptions on pool timeout X-Git-Tag: 3.0.dev1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c96aaf846d82253d7dfcb8284192e4c26d6ccbd;p=thirdparty%2Fpsycopg.git Don't chain exceptions on pool timeout --- diff --git a/psycopg/psycopg/pool/async_pool.py b/psycopg/psycopg/pool/async_pool.py index eadc693a9..947f2f86e 100644 --- a/psycopg/psycopg/pool/async_pool.py +++ b/psycopg/psycopg/pool/async_pool.py @@ -95,7 +95,7 @@ class AsyncConnectionPool(BasePool[AsyncConnection[Any]]): await self.close() # stop all the threads raise PoolTimeout( f"pool initialization incomplete after {timeout} sec" - ) + ) from None async with self._lock: assert self._pool_full_event diff --git a/psycopg/psycopg/pool/pool.py b/psycopg/psycopg/pool/pool.py index 33d31ce4c..8a2868236 100644 --- a/psycopg/psycopg/pool/pool.py +++ b/psycopg/psycopg/pool/pool.py @@ -105,7 +105,7 @@ class ConnectionPool(BasePool[Connection[Any]]): immediately after its creation. The first client will be served as soon as a connection is ready. You can use this method if you prefer your program to terminate in case the environment is not configured - properly, rather than trying to stay up the harder it can. + properly, rather than trying to stay up the hardest it can. """ with self._lock: assert not self._pool_full_event