From 923a16f8f6ccd22f192bdae5a494dba78abd54d4 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Mon, 3 Mar 2025 04:06:31 +0100 Subject: [PATCH] distro/repo_config: ReposConfigFile: default to allow_extra=True --- distro/repo_config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/distro/repo_config.py b/distro/repo_config.py index 88092af..f5f63ab 100644 --- a/distro/repo_config.py +++ b/distro/repo_config.py @@ -51,8 +51,8 @@ class ReposConfigFile(DictScheme): _strip_hidden: ClassVar[bool] = True _sparse: ClassVar[bool] = True - def __init__(self, d, **kwargs): - super().__init__(d=d, **kwargs) + def __init__(self, d, *, allow_extra: bool = True, **kwargs): + super().__init__(d=d, allow_extra=allow_extra, **kwargs) self[REPOS_KEY] = self.get(REPOS_KEY, {}) for repo_cls, defaults, repos, remote_url in [ (RepoConfig, REPO_DEFAULTS, self.get(REPOS_KEY), d.get(REMOTEURL_KEY, None)), @@ -66,6 +66,9 @@ class ReposConfigFile(DictScheme): _repo[REMOTEURL_KEY] = remote_url repos[name] = repo_cls(_repo, **kwargs) + def update(self, *kargs, allow_extra: bool = True, **kwargs): + return super().update(*kargs, allow_extra=allow_extra, **kwargs) # type: ignore[misc] + @staticmethod def parse_config(path: str) -> ReposConfigFile: try: