aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-10-12 14:25:29 +0530
committerXavier Claessens <xclaesse@gmail.com>2022-10-12 08:13:02 -0400
commit9b33885c2d00bb3737d3f35c278d599c50cfd609 (patch)
tree8c661c6a3612902d1d855653e27df1c6728cfe82 /mesonbuild
parentc50d837a0c05a6047e5b13d7cdb3ade3e08c6296 (diff)
downloadmeson-9b33885c2d00bb3737d3f35c278d599c50cfd609.zip
meson-9b33885c2d00bb3737d3f35c278d599c50cfd609.tar.gz
meson-9b33885c2d00bb3737d3f35c278d599c50cfd609.tar.bz2
interpreter: Fix msg when none of the dependencies have names
This case is identical to the case when there's no dependencies specified, so it should behave the same way.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/interpreter/compiler.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/mesonbuild/interpreter/compiler.py b/mesonbuild/interpreter/compiler.py
index 6cf264f..b46e502 100644
--- a/mesonbuild/interpreter/compiler.py
+++ b/mesonbuild/interpreter/compiler.py
@@ -193,10 +193,6 @@ class CompilerHolder(ObjectHolder['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):
@@ -211,8 +207,10 @@ class CompilerHolder(ObjectHolder['Compiler']):
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