From b471d6f7093da9a79c6cd4874ea0c47a31411efc Mon Sep 17 00:00:00 2001 From: Allen Li Date: Tue, 17 Sep 2024 20:30:04 +0000 Subject: [PATCH] [scm] Fix type annotations Change-Id: If18010e076b4b9bac540ff03daefc7d312713778 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5867128 Reviewed-by: Josip Sokcevic Commit-Queue: Allen Li --- scm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scm.py b/scm.py index 200fa8ab1..6bc912505 100644 --- a/scm.py +++ b/scm.py @@ -52,7 +52,7 @@ def determine_scm(root): GitConfigScope = Literal['system', 'global', 'local', 'worktree'] GitScopeOrder: list[GitConfigScope] = ['system', 'global', 'local', 'worktree'] -GitFlatConfigData = Mapping[str, Sequence[str]] +GitFlatConfigData = Mapping[str, Mapping[str, Sequence[str]]] class GitConfigStateBase(metaclass=abc.ABCMeta): @@ -395,7 +395,7 @@ class GitConfigStateReal(GitConfigStateBase): assert isinstance(rawConfig, str) cfg: Dict[str, Dict[str, - List[str]]] = defaultdict(lambda: defaultdict(list)) + list[str]]] = defaultdict(lambda: defaultdict(list)) entries = rawConfig.split('\x00')[:-1] @@ -535,8 +535,8 @@ class GitConfigStateTest(GitConfigStateBase): raise GitConfigUnknownScope(scope) def load_config(self) -> GitFlatConfigData: - cfg: Dict[str, Dict[str, - List[str]]] = defaultdict(lambda: defaultdict(list)) + cfg: Mapping[str, Mapping[str, list[str]]] = defaultdict( + lambda: defaultdict(list)) for key, values in self.system_state.items(): cfg['system'][key].extend(values)