]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore(pool): use coro test from inspect instead of asyncio
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 1 Sep 2025 09:23:59 +0000 (11:23 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 1 Sep 2025 09:34:59 +0000 (11:34 +0200)
The latter is deprecated in Python 3.14.

psycopg_pool/psycopg_pool/pool_async.py

index af725a8e46f3477e56a581fefacb8ae2a3611197..f6c06df12f915db05f06dca189082e9e016a6c1e 100644 (file)
@@ -597,7 +597,9 @@ class AsyncConnectionPool(Generic[ACT], BasePool):
             return
 
         if True:  # ASYNC
-            if asyncio.iscoroutinefunction(self._reconnect_failed):
+            import inspect
+
+            if inspect.iscoroutinefunction(self._reconnect_failed):
                 await self._reconnect_failed(self)
             else:
                 self._reconnect_failed(self)