From 56c7bbc8313b23b784ef0d486a7edcc0ee08f129 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 17 Oct 2024 15:49:42 +0200 Subject: [PATCH] gui: do not add a console logger when there is no sys.stdout Change-Id: Icfd39bd508b5d482c902e6e781cbc557085b0c2e Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/34829 Tested-by: Jenkins Automated Tests Reviewed-by: Georg Brandl --- bin/frappy-gui | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/frappy-gui b/bin/frappy-gui index eafb54d..b77791e 100755 --- a/bin/frappy-gui +++ b/bin/frappy-gui @@ -64,9 +64,10 @@ def main(argv=None): loglevel = logging.DEBUG if args.debug else (logging.ERROR if args.quiet else logging.INFO) logger = logging.getLogger('gui') logger.setLevel(logging.DEBUG) - console = ColoredConsoleHandler() - console.setLevel(loglevel) - logger.addHandler(console) + if sys.stdout is not None: + console = ColoredConsoleHandler() + console.setLevel(loglevel) + logger.addHandler(console) app = QApplication(argv)