From eb8438c0013f8da4ee6b25a8f94d14bfa33a57c4 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 21 Sep 2022 11:33:52 +0200 Subject: mmdebstrap: fix last mypy error mypy was failing to infer the type of the dict object and considered it values Any. --- mdbp/mmdebstrap.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'mdbp') diff --git a/mdbp/mmdebstrap.py b/mdbp/mmdebstrap.py index 37b6655..9726a03 100644 --- a/mdbp/mmdebstrap.py +++ b/mdbp/mmdebstrap.py @@ -105,11 +105,17 @@ def hook_main(build: JsonObject, chroot: pathlib.Path) -> None: hostarch = build.get("host_architecture") or \ build.get("build_architecture") or \ native_architecture() - cmd = [*apt_get, "build-dep", "--host-architecture", hostarch, - *dict(any=["--arch-only"], - all=["--indep-only"]).get(build.get("type"), ()), - *profile_option(build, "--build-profiles"), - "./"] + type_map: typing.Dict[typing.Any, typing.Sequence[str]] = dict( + any=["--arch-only"], all=["--indep-only"] + ) + cmd = [ + *apt_get, + "build-dep", + *("--host-architecture", hostarch), + *type_map.get(build.get("type"), ()), + *profile_option(build, "--build-profiles"), + "./", + ] try: priv_drop(cmd, chroot=chroot, chdir=builddir / subdir) except subprocess.CalledProcessError: -- cgit v1.2.3