From 68f917286f0924eb9061a6c849bb574264632fe9 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 23 Mar 2026 20:45:28 +0000 Subject: [PATCH] move empty response test into {OutConsole}.print_response() --- src/q3rcon_cli/cli.py | 3 +-- src/q3rcon_cli/console.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/q3rcon_cli/cli.py b/src/q3rcon_cli/cli.py index 14a8193..6185b86 100644 --- a/src/q3rcon_cli/cli.py +++ b/src/q3rcon_cli/cli.py @@ -117,8 +117,7 @@ class Q3rconCli(Command): f"Timeout waiting for response for command: '{command}'" ) - if response: - console.out.print_response(response) + console.out.print_response(response) def main(): diff --git a/src/q3rcon_cli/console.py b/src/q3rcon_cli/console.py index e5b79e8..dbdc41c 100644 --- a/src/q3rcon_cli/console.py +++ b/src/q3rcon_cli/console.py @@ -50,9 +50,8 @@ class OutConsole(Console): return OutConsole.COLOUR_CODE_REGEX.sub('', s) def print_response(self, response: str): - response = self._remove_colour_codes(response).removeprefix('print\n') - - cprint(response, fg=self.style) + if response := self._remove_colour_codes(response).removeprefix('print\n'): + cprint(response, fg=self.style) def print_status(self, response: str): _slots = []