aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-12-07 15:00:28 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-04 12:20:59 -0800
commitf14bf8b2ed052f68857ed3eaec08a326d335a3a4 (patch)
tree90b5d0f1ca17e2b31827b5f755a4e94af0690ffe /mesonbuild/mintro.py
parenta539fda0cf6342398fae802827221ed15df5de56 (diff)
downloadmeson-f14bf8b2ed052f68857ed3eaec08a326d335a3a4.zip
meson-f14bf8b2ed052f68857ed3eaec08a326d335a3a4.tar.gz
meson-f14bf8b2ed052f68857ed3eaec08a326d335a3a4.tar.bz2
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.
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 706c585..52f4ac0 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)