From 5fb10d975826d9f89cdc10bf0d15cd5e609aad05 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:19:56 +0900 Subject: [PATCH] change: suppress missing shortcuts message --- dzgui/api/shortcuts.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dzgui/api/shortcuts.py b/dzgui/api/shortcuts.py index 2ecb076..11bd80d 100644 --- a/dzgui/api/shortcuts.py +++ b/dzgui/api/shortcuts.py @@ -173,11 +173,12 @@ class Shortcuts: self.save_shortcuts() def save_shortcuts(self) -> None: - try: - backup = self.shortcuts_path.with_suffix(".vdf.bak") - shutil.copy(self.shortcuts_path, backup) - except Exception as e: - logger.critical(e) + if self.shortcuts_path.is_file(): + try: + backup = self.shortcuts_path.with_suffix(".vdf.bak") + shutil.copy(self.shortcuts_path, backup) + except Exception as e: + logger.critical(e) try: with open(self.shortcuts_path, "wb") as f: vdf.binary_dump(self.shortcuts, f)