diff --git a/src/fprime/fbuild/cmake.py b/src/fprime/fbuild/cmake.py index 3ee2a2ed..bc6e3690 100644 --- a/src/fprime/fbuild/cmake.py +++ b/src/fprime/fbuild/cmake.py @@ -556,7 +556,7 @@ def _communicate(proc, stdout, stderr, print_output=True): appendable.append(line) # Streams are EOF when the line returned is empty. Once this occurs, we are responsible for closing the # stream and thus closing the select loop. Empty strings need not be printed. - if line == "": + if not line: key.fileobj.close() continue # Forwards output to screen. Assuming a PTY is used, then coloring highlights should be automatically diff --git a/src/fprime/fbuild/settings.py b/src/fprime/fbuild/settings.py index 19e4a17f..fe0f27b4 100644 --- a/src/fprime/fbuild/settings.py +++ b/src/fprime/fbuild/settings.py @@ -54,7 +54,7 @@ def read_safe_path( all_paths = parser.get(section, key, fallback="").split(":") expanded = [] for path in all_paths: - if path == "" or path is None: + if not path: continue full_path = os.path.abspath(os.path.normpath(os.path.join(base_dir, path))) if exists and not os.path.exists(full_path): diff --git a/src/fprime/util/string_util.py b/src/fprime/util/string_util.py index 958d717f..00ad8fdc 100644 --- a/src/fprime/util/string_util.py +++ b/src/fprime/util/string_util.py @@ -66,7 +66,7 @@ def convert(match_obj, ignore_int): elif all([not ignore_int, str(conversion_type).lower() == "d"]): format_template += f"{conversion_type}" - return "{}" if format_template == "" else "{:" + format_template + "}" + return "{}" if not format_template else "{:" + format_template + "}" def convert_include_all(match_obj): return convert(match_obj, ignore_int=False)