commit: 754010f346ec2455ea8c71a6af4796c10fd28d23 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sun Apr 8 21:36:07 2018 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sun Apr 8 21:36:07 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=754010f3
EventLoop: add is_closed method for asyncio compat (bug 591760) Bug: https://bugs.gentoo.org/591760 pym/portage/util/_eventloop/EventLoop.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/portage/util/_eventloop/EventLoop.py b/pym/portage/util/_eventloop/EventLoop.py index 4ec67241f..1bf606354 100644 --- a/pym/portage/util/_eventloop/EventLoop.py +++ b/pym/portage/util/_eventloop/EventLoop.py @@ -747,6 +747,10 @@ class EventLoop(object): self._default_executor = executor return executor.submit(func, *args) + def is_closed(self): + """Returns True if the event loop was closed.""" + return self._poll_obj is None + def close(self): """Close the event loop.