From 867277fe01a22e1acb1bd1f118e9f4d53a6dbf3e Mon Sep 17 00:00:00 2001 From: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:38:38 +0000 Subject: [PATCH] lower before compare (#4133) --- openbb_terminal/core/completer/choices.py | 6 +++--- openbb_terminal/decorators.py | 2 +- openbb_terminal/portfolio/portfolio_engine.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openbb_terminal/core/completer/choices.py b/openbb_terminal/core/completer/choices.py index ba9ffbed834..6d3a58dc01a 100644 --- a/openbb_terminal/core/completer/choices.py +++ b/openbb_terminal/core/completer/choices.py @@ -214,7 +214,7 @@ def __patch_controller_functions(controller): ), ] - if environ.get("DEBUG_MODE", "false") != "true": + if str(environ.get("DEBUG_MODE", "false")).lower() != "true": rich.start() patched_function_list = [] for patcher in patcher_list: @@ -222,7 +222,7 @@ def __patch_controller_functions(controller): yield patched_function_list - if environ.get("DEBUG_MODE", "false") != "true": + if str(environ.get("DEBUG_MODE", "false")).lower() != "true": rich.stop() for patcher in patcher_list: patcher.stop() @@ -319,7 +319,7 @@ def build_controller_choice_map(controller) -> dict: argument_parser=argument_parser ) except Exception as exception: - if environ.get("DEBUG_MODE", "false") == "true": + if str(environ.get("DEBUG_MODE", "false")).lower() == "true": raise Exception( f"On command : `{command}`.\n{str(exception)}" ) from exception diff --git a/openbb_terminal/decorators.py b/openbb_terminal/decorators.py index f94cbb0227b..9ced3603f06 100644 --- a/openbb_terminal/decorators.py +++ b/openbb_terminal/decorators.py @@ -60,7 +60,7 @@ def log_start_end(func=None, log=None): extra={"func_name_override": func.__name__}, ) - if os.environ.get("DEBUG_MODE") == "true": + if str(os.environ.get("DEBUG_MODE")).lower() == "true": value = func(*args, **kwargs) log.info("END", extra={"func_name_override": func.__name__}) return value diff --git a/openbb_terminal/portfolio/portfolio_engine.py b/openbb_terminal/portfolio/portfolio_engine.py index 8a4357cec06..22d33b552a2 100644 --- a/openbb_terminal/portfolio/portfolio_engine.py +++ b/openbb_terminal/portfolio/portfolio_engine.py @@ -195,7 +195,7 @@ class PortfolioEngine: # Load transactions from file if path.endswith(".xlsx"): - if environ.get("DEBUG_MODE", "false") != "true": + if str(environ.get("DEBUG_MODE", "false")).lower() != "true": warnings.filterwarnings( "ignore", category=UserWarning, module="openpyxl" )