]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix: fix wait_async with timeout 0
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 30 Jan 2024 02:29:05 +0000 (02:29 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 30 Jan 2024 10:22:18 +0000 (10:22 +0000)
psycopg/psycopg/waiting.py

index 6315c0ad7c459224af7db1b742f35336e79de053..4f307b6ef38693235b542cd9d8c84fb636de732a 100644 (file)
@@ -112,7 +112,7 @@ async def wait_async(
         `Ready` values when it would block.
     :param fileno: the file descriptor to wait on.
     :param timeout: timeout (in seconds) to check for other interrupt, e.g.
-        to allow Ctrl-C. If zero or None, wait indefinitely.
+        to allow Ctrl-C. If zero, wait indefinitely.
     :return: whatever `!gen` returns on completion.
 
     Behave like in `wait()`, but exposing an `asyncio` interface.
@@ -143,7 +143,7 @@ async def wait_async(
             if writer:
                 loop.add_writer(fileno, wakeup, READY_W)
             try:
-                if timeout:
+                if timeout is not None:
                     try:
                         await wait_for(ev.wait(), timeout)
                     except TimeoutError: