commit: 95935004862d1363a0e3d5b6ee33d4ed65566a2d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 21 05:13:12 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 21 05:33:51 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=95935004
portdbapi: convert compat coroutine to async
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
lib/portage/dbapi/porttree.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py
index 72b875879..93f3fee2f 100644
--- a/lib/portage/dbapi/porttree.py
+++ b/lib/portage/dbapi/porttree.py
@@ -38,7 +38,6 @@ from portage import os
from portage import _encodings
from portage import _unicode_encode
from portage.util.futures import asyncio
-from portage.util.futures.compat_coroutine import coroutine, coroutine_return
from portage.util.futures.iter_completed import iter_gather
from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
@@ -1244,8 +1243,7 @@ class portdbapi(dbapi):
loop = self._event_loop
return loop.run_until_complete(self.async_xmatch(level, origdep,
loop=loop))
- @coroutine
- def async_xmatch(self, level, origdep, loop=None):
+ async def async_xmatch(self, level, origdep, loop=None):
"""
Asynchronous form of xmatch.
@@ -1269,7 +1267,7 @@ class portdbapi(dbapi):
if self.frozen:
cache_key = (mydep, mydep.unevaluated_atom)
try:
- coroutine_return(self.xcache[level][cache_key][:])
+ return self.xcache[level][cache_key][:]
except KeyError:
pass
@@ -1336,7 +1334,7 @@ class portdbapi(dbapi):
zip(
aux_keys,
(
- yield self.async_aux_get(
+ await self.async_aux_get(
cpv, aux_keys, myrepo=cpv.repo, loop=loop
)
),
@@ -1384,7 +1382,7 @@ class portdbapi(dbapi):
if not isinstance(myval, _pkg_str):
myval = myval[:]
- coroutine_return(myval)
+ return myval
def match(self, mydep, use_cache=1):
return self.xmatch("match-visible", mydep)