Skip to content

Commit

Permalink
mintro: fix mypy warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dcbaker committed Dec 11, 2020
1 parent 30ebbbf commit 81ebdb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesonbuild/mintro.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def nodes_to_paths(node_list: T.List[BaseNode]) -> T.List[Path]:

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()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 81ebdb1

Please sign in to comment.