From 2aa6b991d3a9a9ff2aee95c2480a3c65ebf4f60d Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 27 Oct 2025 17:38:28 +0000 Subject: [PATCH] Suppress welcome message in 'py list -1' output. Also moves it to standard error instead of stdout. Fixes #203 --- src/manage/commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/manage/commands.py b/src/manage/commands.py index 72fb444..0ffb8f5 100644 --- a/src/manage/commands.py +++ b/src/manage/commands.py @@ -516,7 +516,7 @@ def show_welcome(self, copyright=True): except OSError: LOGGER.debug("Failed to update %s", last_update_file, exc_info=True) return - LOGGER.print(WELCOME) + LOGGER.info(WELCOME) def dump_arguments(self): try: @@ -716,7 +716,10 @@ class ListCommand(BaseCommand): def execute(self): from .list_command import execute - self.show_welcome() + # gh-203: Don't show welcome message for "-1" to minimise the risk of it + # mixing with parsed output. + if not self.one: + self.show_welcome() if self.default_source: LOGGER.debug("Loading 'install' command to get source") inst_cmd = COMMANDS["install"](["install"], self.root)