Fix: Decode run_cmd() result

Since commit 02697af5, ExecContext.run() returns bytes for stdout and
stderr and fixes that in calling code. The thing it did not fix was
the code calling run_cmd(), which also made return bytes. This commit
catches up on that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-23 13:13:55 +01:00
commit 21e67291b5
6 changed files with 12 additions and 14 deletions

View file

@ -30,14 +30,14 @@ async def run_dpkg(args: list[str], sudo: bool=False, ec: ExecContext=None): # e
cmd.extend(args)
if sudo:
return await run_sudo(cmd, ec=ec)
return await run_cmd(cmd, ec=ec)
return (await run_cmd(cmd, ec=ec)).decode()
async def run_dpkg_query(args: list[str], sudo: bool=False, ec: ExecContext=None): # export
cmd = ['/usr/bin/dpkg-query']
cmd.extend(args)
if sudo:
return await run_sudo(cmd)
return await run_cmd(cmd, ec=ec)
return (await run_cmd(cmd, ec=ec)).decode()
async def query_packages(names: Iterable[str] = [], ec: ExecContext=None) -> Iterable[Package]: # export
fmt_str = '|'.join([(f'${{{tag}}}' if tag else '') for tag in meta_map().values()]) + r'\n'