From: Zac Medico Date: Wed, 22 Aug 2012 16:23:18 +0000 (-0700) Subject: EventLoop: handle EINTR IOError for epoll X-Git-Tag: v2.2.0_alpha122~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7a55f93d76bab41f025b77fc4e356d6a5b4b9385;p=portage.git EventLoop: handle EINTR IOError for epoll --- 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)