From 7a55f93d76bab41f025b77fc4e356d6a5b4b9385 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 22 Aug 2012 09:23:18 -0700 Subject: [PATCH] EventLoop: handle EINTR IOError for epoll --- pym/portage/util/_eventloop/EventLoop.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pym/portage/util/_eventloop/EventLoop.py b/pym/portage/util/_eventloop/EventLoop.py index eed68fe00..44a3c26b6 100644 --- a/pym/portage/util/_eventloop/EventLoop.py +++ b/pym/portage/util/_eventloop/EventLoop.py @@ -96,9 +96,11 @@ class EventLoop(object): try: self._poll_event_queue.extend(self._poll_obj.poll(timeout)) break - except select.error as e: + except (IOError, select.error) as e: # Silently handle EINTR, which is normal when we have - # received a signal such as SIGINT. + # received a signal such as SIGINT (epoll objects may + # raise IOError rather than select.error, at least in + # Python 3.2). if not (e.args and e.args[0] == errno.EINTR): writemsg_level("\n!!! select error: %s\n" % (e,), level=logging.ERROR, noiselevel=-1) -- 2.26.2