From f89e2a030622cb7a4d413b1a663758823b008261 Mon Sep 17 00:00:00 2001 From: YoSTEALTH <35307184+YoSTEALTH@users.noreply.github.com> Date: Tue, 13 Feb 2018 20:28:01 -0600 Subject: [PATCH] Fixing epoll `timeout` logic # current if timeout is None: timeout = -1 elif timeout <= 0: timeout = 0 # changed if timeout is None: timeout = -1 elif timeout < -1: timeout = 0 what if "timeout=-1" ? - currently it would result in being timeout=0 --- Lib/selectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/selectors.py b/Lib/selectors.py index a9a0801ef0713b..a8bd309f70fd58 100644 --- a/Lib/selectors.py +++ b/Lib/selectors.py @@ -451,7 +451,7 @@ def fileno(self): def select(self, timeout=None): if timeout is None: timeout = -1 - elif timeout <= 0: + elif timeout < -1: timeout = 0 else: # epoll_wait() has a resolution of 1 millisecond, round away