From 3ca3405920f93d89604aa2cf6783cd1146aa9ada Mon Sep 17 00:00:00 2001 From: martinb-bb <105685594+martinb-bb@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:07:38 -0500 Subject: [PATCH] util linting changes --- openbb_terminal/forecast/whisper_utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openbb_terminal/forecast/whisper_utils.py b/openbb_terminal/forecast/whisper_utils.py index f87f9e4f85e..b3f2b391837 100644 --- a/openbb_terminal/forecast/whisper_utils.py +++ b/openbb_terminal/forecast/whisper_utils.py @@ -5,8 +5,7 @@ def str2bool(string): str2val = {"True": True, "False": False} if string in str2val: return str2val[string] - else: - raise ValueError(f"Expected one of {set(str2val.keys())}, got {string}") + raise ValueError(f"Expected one of {set(str2val.keys())}, got {string}") def format_timestamp( @@ -40,13 +39,11 @@ def break_line(line: str, length: int): while break_index > 1: if line[break_index - 1] == " ": break # break at space - else: - break_index -= 1 + break_index -= 1 if break_index > 1: # split the line, not including the space at break_index return line[: break_index - 1] + "\n" + line[break_index:] - else: - return line + return line def process_segment(segment: dict, line_length: int = 0):