From 105cc68d0e0ca4091d3fa2eeb1ccd7ad65c96e2b Mon Sep 17 00:00:00 2001 From: Shachar Snapiri Date: Wed, 31 Jan 2018 09:40:11 +0200 Subject: [PATCH] Fix SelectSelector to be compatible with monkey_patch When using eventlet.monkey_patch(), it disables all the Selectors but the SelectSelector. Another thing it does is modify how the constructor handles the class methods. The way the SelectSelector handles the _select function is incompatible with that code. We should have a bound method calling the select function (as is done for the Win32) in order to fix this compatibility issue. --- trollius/selectors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trollius/selectors.py b/trollius/selectors.py index cf0475de..2b24e5e0 100644 --- a/trollius/selectors.py +++ b/trollius/selectors.py @@ -309,7 +309,8 @@ def _select(self, r, w, _, timeout=None): r, w, x = select.select(r, w, w, timeout) return r, w + x, [] else: - _select = select.select + def _select(self, r, w, x, timeout=None): + return select.select(r, w, x, timeout) def select(self, timeout=None): timeout = None if timeout is None else max(timeout, 0)