commit: 18b3cb69095a30f52d74f953c186df184e047741 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Tue Sep 21 05:04:15 2021 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Tue Sep 21 05:33:50 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=18b3cb69
SpawnProcess: convert compat coroutine to async Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/_emerge/SpawnProcess.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py index eacc83451..c43b17c12 100644 --- a/lib/_emerge/SpawnProcess.py +++ b/lib/_emerge/SpawnProcess.py @@ -1,4 +1,4 @@ -# Copyright 2008-2020 Gentoo Authors +# Copyright 2008-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 import errno @@ -17,7 +17,6 @@ from portage.util import writemsg_level from portage.util._async.BuildLogger import BuildLogger from portage.util._async.PipeLogger import PipeLogger from portage.util.futures import asyncio -from portage.util.futures.compat_coroutine import coroutine class SpawnProcess(SubProcess): @@ -175,13 +174,12 @@ class SpawnProcess(SubProcess): ) self._main_task.add_done_callback(self._main_exit) - @coroutine - def _main(self, build_logger, pipe_logger, loop=None): + async def _main(self, build_logger, pipe_logger, loop=None): try: if pipe_logger.poll() is None: - yield pipe_logger.async_wait() + await pipe_logger.async_wait() if build_logger.poll() is None: - yield build_logger.async_wait() + await build_logger.async_wait() except asyncio.CancelledError: self._main_cancel(build_logger, pipe_logger) raise