diff --git a/rwx/grub/__init__.py b/rwx/grub/__init__.py index 7c0cccc..accec9f 100644 --- a/rwx/grub/__init__.py +++ b/rwx/grub/__init__.py @@ -25,8 +25,8 @@ def make_image( pubkey_path: str | None = None, ) -> None: """Make a binary bootable image.""" - args: list[str | tuple[str, ...]] = [ - "grub-mkimage", + args = [ + ("grub-mkimage",), ("--compress", COMPRESSION), ("--format", image_format), ("--output", image_path), @@ -35,6 +35,6 @@ def make_image( if pubkey_path: args.append(("--pubkey", pubkey_path)) args.extend(modules) - if extra_modules := MODULES.get(image_format): - args.extend(extra_modules) + if modules := MODULES.get(image_format): + args.extend(modules) ps.run(*args) diff --git a/rwx/ps/__init__.py b/rwx/ps/__init__.py index 0bbab9c..e18e250 100644 --- a/rwx/ps/__init__.py +++ b/rwx/ps/__init__.py @@ -9,11 +9,10 @@ def get_tuples_args(*items: str | tuple[str, ...]) -> list[str]: """Turn arguments tuples into an arguments list.""" args: list[str] = [] for item in items: - match item: - case str(): - args.append(item) - case tuple(): - args.extend(item) + if type(item) is tuple: + args.extend(item) + else: + args.append(item) return args