]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Don't chain exceptions on pool timeout
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 10 Jul 2021 13:09:22 +0000 (15:09 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 10 Jul 2021 15:16:12 +0000 (17:16 +0200)
psycopg/psycopg/pool/async_pool.py
psycopg/psycopg/pool/pool.py

index eadc693a9f73cacee250cd3e338aa88ac5068fe7..947f2f86e02eb1fcb632290d18159f3d546da9c9 100644 (file)
@@ -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
index 33d31ce4c5c426aa4c50f7c8f9f89ef763850b8d..8a2868236d6af85b4d7bba614b4081861f99d602 100644 (file)
@@ -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