refactor: rename warn warning

This commit is contained in:
Dobin
2024-06-02 13:22:10 +01:00
parent dd313ac198
commit fdc2e6a7f8
+4 -4
View File
@@ -74,11 +74,11 @@ def run_process_checkret(args, check=True):
try: try:
ret = subprocess.run(args, capture_output=True) ret = subprocess.run(args, capture_output=True)
except KeyboardInterrupt: except KeyboardInterrupt:
logger.warn("Caught KeyboardInterrupt, exiting gracefully...") logger.warning("Caught KeyboardInterrupt, exiting gracefully...")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
logger.warn(f"Command '{e.cmd}' returned non-zero exit status {e.returncode}.") logger.warning(f"Command '{e.cmd}' returned non-zero exit status {e.returncode}.")
except Exception as e: except Exception as e:
logger.warn(f"An error occurred executing {e}") logger.warning(f"An error occurred executing {e}")
# handle output # handle output
stdout_s = "" stdout_s = ""
@@ -178,7 +178,7 @@ def ui_string_decode(data):
else: else:
return "(utf8) " + data.decode("utf-8") return "(utf8) " + data.decode("utf-8")
except Exception as e: except Exception as e:
logger.warn("ui_string_decode: {}".format(e)) logger.warning("ui_string_decode: {}".format(e))
def ascii_to_hex_bytes(ascii_bytes): def ascii_to_hex_bytes(ascii_bytes):
hex_escaped = ''.join(f'\\x{byte:02x}' for byte in ascii_bytes) hex_escaped = ''.join(f'\\x{byte:02x}' for byte in ascii_bytes)