On 1/4/21 1:06 AM, Zac Medico wrote: > Like asyncio.get_event_loop(), return the running loop for the > current thread if there is one, and otherwise construct a new > one if needed. This allows the _safe_loop function to become > synonymous with the global_event_loop function. > > Bug: https://bugs.gentoo.org/763339 > Signed-off-by: Zac Medico <zmed...@gentoo.org> > --- > .../util/_eventloop/global_event_loop.py | 28 ++----------------- > lib/portage/util/futures/_asyncio/__init__.py | 22 ++++++++++----- > 2 files changed, 17 insertions(+), 33 deletions(-)
For the case of "loop running in non-main thread" of API consumer, this change makes portage compatible with PEP 492 coroutines with async and await syntax. Portage internals can safely begin using async / await syntax instead of compat_coroutine. -- Thanks, Zac
signature.asc
Description: OpenPGP digital signature