From: Jörg Behrmann Date: Mon, 16 Feb 2026 12:14:24 +0000 (+0100) Subject: config: use typing.get_args instead of private fields X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdf14720b3187bd356b9a6dd84bea42e6f9e4e3d;p=thirdparty%2Fmkosi.git config: use typing.get_args instead of private fields This allows us to get rid of one type ignore comment. --- diff --git a/mkosi/config.py b/mkosi/config.py index f10f64d21..3f1bc19e4 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -5950,7 +5950,7 @@ def json_type_transformer(refcls: Union[type[Args], type[Config]]) -> Callable[[ return typing.get_args(fieldtype)[0](enumval) if enumval is not None else None def enum_list_transformer(enumlist: list[str], fieldtype: type[list[E]]) -> list[E]: - enumtype = fieldtype.__args__[0] # type: ignore + enumtype = typing.get_args(fieldtype)[0] return [enumtype(e) for e in enumlist] def config_drive_transformer(drives: list[dict[str, Any]], fieldtype: type[Drive]) -> list[Drive]: