aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-03-10 14:11:24 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2021-03-22 21:29:14 -0400
commit60c2c25d5bb2378b2d8da9ba6b9693a3111f27f5 (patch)
treeffc4be6b6ec07c55ff5c7e90aa0c31cc137a9bbd
parentb33e7bca73007aeec92ecada5642ce6fd08d6f58 (diff)
downloadmeson-60c2c25d5bb2378b2d8da9ba6b9693a3111f27f5.zip
meson-60c2c25d5bb2378b2d8da9ba6b9693a3111f27f5.tar.gz
meson-60c2c25d5bb2378b2d8da9ba6b9693a3111f27f5.tar.bz2
mlog: Do not print 'subproject|' on empty lines
-rw-r--r--mesonbuild/mlog.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py
index c7d5865..c51922a 100644
--- a/mesonbuild/mlog.py
+++ b/mesonbuild/mlog.py
@@ -211,7 +211,11 @@ def force_print(*args: str, **kwargs: T.Any) -> None:
raw = iostr.getvalue()
if log_depth:
prepend = log_depth[-1] + '| '
- raw = prepend + raw.replace('\n', '\n' + prepend, raw.count('\n') - 1)
+ lines = []
+ for l in raw.split('\n'):
+ l = l.strip()
+ lines.append(prepend + l if l else '')
+ raw = '\n'.join(lines)
# _Something_ is going to get printed.
try: