From c38b1e8ea6b372e302b0ed5c617644cb1a24e530 Mon Sep 17 00:00:00 2001 From: Jaspar S Date: Fri, 8 Sep 2023 09:07:01 +0200 Subject: [PATCH] Change: Use else for logger warning (#875) --- pontos/version/commands/_java.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pontos/version/commands/_java.py b/pontos/version/commands/_java.py index f7d68ac8..926e0594 100644 --- a/pontos/version/commands/_java.py +++ b/pontos/version/commands/_java.py @@ -74,12 +74,13 @@ def replace_string_in_file( file_path.write_text( content.replace(match.group(1), replacement), encoding="utf-8" ) - logging.warning( - "Couldn't match the pattern %s in the content of %s.", - pattern, - file_path, - ) - logging.warning("Content: %s", content) + else: + logging.warning( + "Couldn't match the pattern %s in the content of %s.", + pattern, + file_path, + ) + logging.warning("Content: %s", content) # This class is used for Java Version command(s)