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 <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2020-11-13 08:23:05 +01:00
parent 204019f54e
commit 79641ac382

View File

@ -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: