commit:     4fb5ef2ce2cb27ae155a25bfa5a4666597afb6ac
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 26 20:20:06 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 26 20:20:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4fb5ef2c

EventLoop.close: fix 'AttributeError: close' for python2

For python2 without epoll, fix handling of missing
'close' attribute on self._poll_obj.

Fixes: 4095be74985c ("Add ForkExecutor (bug 649588)")
Reported-by: Brian Evans <grknight <AT> gentoo.org>

 pym/portage/util/_eventloop/EventLoop.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/util/_eventloop/EventLoop.py 
b/pym/portage/util/_eventloop/EventLoop.py
index de0795224..df76374d9 100644
--- a/pym/portage/util/_eventloop/EventLoop.py
+++ b/pym/portage/util/_eventloop/EventLoop.py
@@ -968,7 +968,7 @@ class EventLoop(object):
                        executor.shutdown(wait=True)
 
                if self._poll_obj is not None:
-                       close = getattr(self._poll_obj, 'close')
+                       close = getattr(self._poll_obj, 'close', None)
                        if close is not None:
                                close()
                        self._poll_obj = None

Reply via email to