psycopg.git / summary / log / commit / refs
commit 00dbeb6cc2a3e1de76714e6450b177e5537a00a5
Author: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: Tue Feb 16 19:04:49 2021 +0000
Don't use epoll module definitions if it's not the default selector
Close #34
psycopg3/psycopg3/waiting.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/psycopg3/psycopg3/waiting.py b/psycopg3/psycopg3/waiting.py
index bfab413e..e6070248 100644
--- a/psycopg3/psycopg3/waiting.py
+++ b/psycopg3/psycopg3/waiting.py
@@ -196,13 +196,6 @@ async def wait_conn_async(gen: PQGenConn[RV]) -> RV:
return rv
-poll_evmasks = {
- Wait.R: select.EPOLLONESHOT | select.EPOLLIN,
- Wait.W: select.EPOLLONESHOT | select.EPOLLOUT,
- Wait.RW: select.EPOLLONESHOT | select.EPOLLIN | select.EPOLLOUT,
-}
-
-
def wait_epoll(
gen: PQGen[RV], fileno: int, timeout: Optional[float] = None
) -> RV:
@@ -247,5 +240,12 @@ if (
is selectors.EpollSelector
):
wait = wait_epoll
+
+ poll_evmasks = {
+ Wait.R: select.EPOLLONESHOT | select.EPOLLIN,
+ Wait.W: select.EPOLLONESHOT | select.EPOLLOUT,
+ Wait.RW: select.EPOLLONESHOT | select.EPOLLIN | select.EPOLLOUT,
+ }
+
else:
wait = wait_selector
[parent: 8a454eb9a81f]