mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[scm] Fix type annotations
Change-Id: If18010e076b4b9bac540ff03daefc7d312713778 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5867128 Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Allen Li <ayatane@chromium.org>
This commit is contained in:
8
scm.py
8
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)
|
||||
|
||||
Reference in New Issue
Block a user