Skip to content

Commit

Permalink
interpreter: Fix msg when none of the dependencies have names
Browse files Browse the repository at this point in the history
This case is identical to the case when there's no dependencies
specified, so it should behave the same way.
  • Loading branch information
nirbheek authored and xclaesse committed Oct 12, 2022
1 parent c50d837 commit 9b33885
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mesonbuild/interpreter/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ def compiler(self) -> 'Compiler':
def _dep_msg(self, deps: T.List['dependencies.Dependency'], compile_only: bool, endl: str) -> str:
msg_single = 'with dependency {}'
msg_many = 'with dependencies {}'
if not deps:
return endl
if endl is None:
endl = ''
names = []
for d in deps:
if isinstance(d, dependencies.InternalDependency):
Expand All @@ -211,8 +207,10 @@ def _dep_msg(self, deps: T.List['dependencies.Dependency'], compile_only: bool,
name = d.name
names.append(name)
if not names:
return None
return endl
tpl = msg_many if len(names) > 1 else msg_single
if endl is None:
endl = ''
return tpl.format(', '.join(names)) + endl

@noPosargs
Expand Down

0 comments on commit 9b33885

Please sign in to comment.