From 6c29bfbf57046c323a1fc3fca42380c441bd904b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 8 Mar 2015 13:27:42 +0200 Subject: [PATCH] select: Handle EINTR. --- select/select.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/select/select.py b/select/select.py index 29d10881..c9d66722 100644 --- a/select/select.py +++ b/select/select.py @@ -66,8 +66,11 @@ class Epoll: def poll(self, timeout=-1): s = bytearray(self.evbuf) - n = epoll_wait(self.epfd, s, 1, timeout) - os.check_error(n) + while True: + n = epoll_wait(self.epfd, s, 1, timeout) + if not os.check_error(n): + break + # TODO: what about timeout value? res = [] if n > 0: vals = struct.unpack(epoll_event, s)