summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2022-09-21 11:33:52 +0200
committerHelmut Grohne <helmut@subdivi.de>2022-09-21 11:33:52 +0200
commiteb8438c0013f8da4ee6b25a8f94d14bfa33a57c4 (patch)
treea9fb702847ec405ee920b0ed63f729d9ed9c24c9
parent3ba0ba8d2c81b4aa816dd003fc4e8f1379c17090 (diff)
downloadmdbp-eb8438c0013f8da4ee6b25a8f94d14bfa33a57c4.tar.gz
mmdebstrap: fix last mypy error
mypy was failing to infer the type of the dict object and considered it values Any.
-rw-r--r--mdbp/mmdebstrap.py16
1 files changed, 11 insertions, 5 deletions
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: