From 8ca34c551b442e34dc5a7fb3693399a9b6361633 Mon Sep 17 00:00:00 2001 From: Nikita Akatyev Date: Fri, 1 Sep 2023 16:28:28 +0200 Subject: [PATCH] cli_out_write: don't decorate data if colors are not set --- conan/api/output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conan/api/output.py b/conan/api/output.py index 34d10ac94d9..179d983cb13 100644 --- a/conan/api/output.py +++ b/conan/api/output.py @@ -227,7 +227,7 @@ def cli_out_write(data, fg=None, bg=None, endline="\n", indentation=0): fg_ = fg or '' bg_ = bg or '' - if color_enabled(sys.stdout): + if (fg or bg) and color_enabled(sys.stdout): data = f"{' ' * indentation}{fg_}{bg_}{data}{Style.RESET_ALL}{endline}" else: data = f"{' ' * indentation}{data}{endline}"