From: Daniele Varrazzo Date: Tue, 16 Feb 2021 19:04:49 +0000 (+0100) Subject: Don't use epoll module definitions if it's not the default selector X-Git-Tag: 3.0.dev0~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00dbeb6cc2a3e1de76714e6450b177e5537a00a5;p=thirdparty%2Fpsycopg.git Don't use epoll module definitions if it's not the default selector Close #34 --- diff --git a/psycopg3/psycopg3/waiting.py b/psycopg3/psycopg3/waiting.py index bfab413e1..e60702487 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