Another batch of linter fixes

This commit is contained in:
deajan 2025-07-03 10:24:33 +02:00
parent 67ea2bb446
commit b1799a9586
6 changed files with 9 additions and 7 deletions

View file

@ -258,7 +258,6 @@ def convert_to_commented_map(
return CommentedMap( return CommentedMap(
{k: convert_to_commented_map(v) for k, v in source_dict.items()} {k: convert_to_commented_map(v) for k, v in source_dict.items()}
) )
else:
return source_dict return source_dict

View file

@ -219,8 +219,10 @@ def send_prometheus_metrics(
upload_metrics(destination, authentication, no_cert_verify, metrics) upload_metrics(destination, authentication, no_cert_verify, metrics)
else: else:
write_metrics_file(destination, metrics, append=append_metrics_file) write_metrics_file(destination, metrics, append=append_metrics_file)
return True
else: else:
logger.debug("No metrics destination set. Not sending metrics") logger.debug("No metrics destination set. Not sending metrics")
return True
def send_metrics_mail( def send_metrics_mail(

View file

@ -26,7 +26,7 @@ def get_restic_internal_binary(arch: str) -> str:
binary = None binary = None
if os.path.isdir(RESTIC_SOURCE_FILES_DIR): if os.path.isdir(RESTIC_SOURCE_FILES_DIR):
if os.name == "nt": if os.name == "nt":
if IS_LEGACY or "legacy" in "arch": if IS_LEGACY or "legacy" in arch:
# Last compatible restic binary for Windows 7, see https://github.com/restic/restic/issues/5065 # Last compatible restic binary for Windows 7, see https://github.com/restic/restic/issues/5065
# We build a legacy version of restic for windows 7 and Server 2008R2 # We build a legacy version of restic for windows 7 and Server 2008R2
logger.info( logger.info(

View file

@ -38,6 +38,7 @@ def handle_current_window(action: str = "minimize") -> None:
current_executable = os.path.abspath(sys.argv[0]) current_executable = os.path.abspath(sys.argv[0])
# console window will have the name of current executable # console window will have the name of current executable
# pylint: disable=I1101 (c-extension-no-member)
hWnd = win32gui.FindWindow(None, current_executable) hWnd = win32gui.FindWindow(None, current_executable)
if not hWnd: if not hWnd:
logger.debug( logger.debug(

View file

@ -350,7 +350,7 @@ def gui_thread_runner(
if __fn_name == "restore": if __fn_name == "restore":
try: try:
stdout_cache = json.dumps(json.loads(stdout_cache), indent=4) stdout_cache = json.dumps(json.loads(stdout_cache), indent=4)
except json.JSONDecodeError as exc: except json.JSONDecodeError:
pass pass
# Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second # Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second
if ( if (