public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/_async/
Date: Tue, 21 Sep 2021 05:51:52 +0000 (UTC)	[thread overview]
Message-ID: <1632199785.3f2ba95a960ed66dde1a0e4cea99f5d54b018d0f.zmedico@gentoo> (raw)

commit:     3f2ba95a960ed66dde1a0e4cea99f5d54b018d0f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 21 04:49:23 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 21 04:49:45 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f2ba95a

ForkProcess: convert compat coroutine to async

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/util/_async/ForkProcess.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/portage/util/_async/ForkProcess.py b/lib/portage/util/_async/ForkProcess.py
index 674336935..e70238705 100644
--- a/lib/portage/util/_async/ForkProcess.py
+++ b/lib/portage/util/_async/ForkProcess.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2020 Gentoo Authors
+# Copyright 2012-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import fcntl
@@ -10,7 +10,6 @@ import sys
 import portage
 from portage import os
 from portage.util.futures import asyncio
-from portage.util.futures.compat_coroutine import coroutine
 from _emerge.SpawnProcess import SpawnProcess
 
 
@@ -73,15 +72,14 @@ class ForkProcess(SpawnProcess):
         if self._proc_join_task is None:
             super(ForkProcess, self)._async_waitpid()
 
-    @coroutine
-    def _proc_join(self, proc, loop=None):
+    async def _proc_join(self, proc, loop=None):
         sentinel_reader = self.scheduler.create_future()
         self.scheduler.add_reader(
             proc.sentinel,
             lambda: sentinel_reader.done() or sentinel_reader.set_result(None),
         )
         try:
-            yield sentinel_reader
+            await sentinel_reader
         finally:
             # If multiprocessing.Process supports the close method, then
             # access to proc.sentinel will raise ValueError if the
@@ -101,7 +99,7 @@ class ForkProcess(SpawnProcess):
             proc.join(0)
             if proc.exitcode is not None:
                 break
-            yield asyncio.sleep(self._proc_join_interval, loop=loop)
+            await asyncio.sleep(self._proc_join_interval, loop=loop)
 
     def _proc_join_done(self, proc, future):
         future.cancelled() or future.result()


             reply	other threads:[~2021-09-21  5:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21  5:51 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-14 15:45 [gentoo-commits] proj/portage:master commit in: lib/portage/util/_async/ Zac Medico
2024-02-07  2:35 Zac Medico
2024-02-03 22:54 Zac Medico
2023-12-06 16:25 Zac Medico
2023-10-05  6:28 Zac Medico
2023-10-04  4:01 Zac Medico
2023-10-04  3:25 Zac Medico
2023-10-03 14:48 Zac Medico
2023-10-03 14:48 Zac Medico
2021-05-02  0:00 Zac Medico
2021-03-07 15:17 Zac Medico
2021-03-07 15:17 Zac Medico
2021-02-15  4:38 Zac Medico
2020-08-09  0:46 Zac Medico
2020-08-03 23:28 Zac Medico
2020-06-24  4:36 Zac Medico
2020-06-14  0:02 Zac Medico
2020-04-08  5:56 Zac Medico
2020-03-01  1:22 Zac Medico
2020-02-29  7:51 Zac Medico
2020-02-29  7:51 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1632199785.3f2ba95a960ed66dde1a0e4cea99f5d54b018d0f.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox