From f14bf8b2ed052f68857ed3eaec08a326d335a3a4 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 7 Dec 2020 15:00:28 -0800 Subject: mintro: fix mypy warning The output of list_targets is a pretty horrific jumble of things. We really need a TypeDict to make this not so terrible we can't deal with it, so for now just use Any. --- mesonbuild/mintro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 706c585cd..52f4ac0cb 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -170,8 +170,8 @@ def list_targets_from_source(intr: IntrospectionInterpreter) -> T.List[T.Dict[st return tlist -def list_targets(builddata: build.Build, installdata: backends.InstallData, backend: backends.Backend) -> T.List[T.Dict[str, T.Union[bool, str, T.List[T.Union[str, T.Dict[str, T.Union[str, T.List[str], bool]]]]]]]: - tlist = [] # type: T.List[T.Dict[str, T.Union[bool, str, T.List[T.Union[str, T.Dict[str, T.Union[str, T.List[str], bool]]]]]]] +def list_targets(builddata: build.Build, installdata: backends.InstallData, backend: backends.Backend) -> T.List[T.Any]: + tlist = [] # type: T.List[T.Any] build_dir = builddata.environment.get_build_dir() src_dir = builddata.environment.get_source_dir() @@ -200,8 +200,8 @@ def list_targets(builddata: build.Build, installdata: backends.InstallData, back if installdata and target.should_install(): t['installed'] = True - t['install_filename'] = [install_lookuptable.get(x, [None]) for x in target.get_outputs()] - t['install_filename'] = [x for sublist in t['install_filename'] for x in sublist] # flatten the list + ifn = [install_lookuptable.get(x, [None]) for x in target.get_outputs()] + t['install_filename'] = [x for sublist in ifn for x in sublist] # flatten the list else: t['installed'] = False tlist.append(t) -- cgit v1.2.3