aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2025-08-16 21:09:19 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2025-08-16 21:09:19 +0100
commitf3a38d53819e2cc9ba2587dddde458d1d64b26ea (patch)
treead7e95e7ff6203dd357f5b00c50e92b3ad782327
parentd6d5e7ffff7baabc274200d6e4db7730e44318a5 (diff)
downloadkutter-f3a38d53819e2cc9ba2587dddde458d1d64b26ea.tar.gz
kutter-f3a38d53819e2cc9ba2587dddde458d1d64b26ea.tar.xz
kutter-f3a38d53819e2cc9ba2587dddde458d1d64b26ea.zip
Don't require an existing saved config
-rw-r--r--klippy/configfile.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py
index e56e8d86..f04bfe32 100644
--- a/klippy/configfile.py
+++ b/klippy/configfile.py
@@ -464,7 +464,10 @@ class ConfigAutoSave:
f = open(temp_name, "w")
f.write(autosave_data)
f.close()
- shutil.copy2(autosave_filename, backup_name)
+ try:
+ shutil.copy2(autosave_filename, backup_name)
+ except FileNotFoundError:
+ pass
os.rename(temp_name, autosave_filename)
except:
msg = "Unable to write config file during SAVE_CONFIG"