From 79641ac382411351b9e82ed9a7e600d4b1243ac2 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 13 Nov 2020 08:23:05 +0100 Subject: [PATCH] libkas: Acount for changes to asyncio.wait Only tasks should be provided to it, no longer coroutines. Python 3.9 starts to complain about the deprecated pattern. Signed-off-by: Jan Kiszka --- kas/libkas.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kas/libkas.py b/kas/libkas.py index b0879cb..a1aee6d 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -109,10 +109,11 @@ async def run_cmd_async(cmd, cwd, env=None, fail=True, liveupdate=True): raise ex return (errno.EPERM, str(ex)) - await asyncio.wait([ - _read_stream(process.stdout, logo.log_stdout), - _read_stream(process.stderr, logo.log_stderr) - ]) + tasks = [ + asyncio.ensure_future(_read_stream(process.stdout, logo.log_stdout)), + asyncio.ensure_future(_read_stream(process.stderr, logo.log_stderr)) + ] + await asyncio.wait(tasks) ret = await process.wait() if ret and fail: