From e92a4ee3825a42b30cd908403eae40c8400f6d9b Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 9 Jun 2026 11:22:44 +0200 Subject: [PATCH] PySimLogger: move cmd2 import to where it is needed The PySimLogger has a dependency to cmd2, however this dependency is only required in one specific corner case. We can move the import to the related code section and remove the dependency for all other cases. Change-Id: Idfdfcd27eef8d87bea75230600c7be1e7a8ba749 Related: SYS#6959 --- pySim/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pySim/log.py b/pySim/log.py index 345cf78a..073fcc1e 100644 --- a/pySim/log.py +++ b/pySim/log.py @@ -24,7 +24,6 @@ # import logging -from cmd2 import style class _PySimLogHandler(logging.Handler): def __init__(self, log_callback): @@ -121,6 +120,7 @@ class PySimLogger: if isinstance(color, str): PySimLogger.print_callback(color + formatted_message + "\033[0m") else: + from cmd2 import style PySimLogger.print_callback(style(formatted_message, fg = color)) else: PySimLogger.print_callback(formatted_message)