diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2025-08-16 21:09:19 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2025-08-16 21:09:19 +0100 |
commit | f3a38d53819e2cc9ba2587dddde458d1d64b26ea (patch) | |
tree | ad7e95e7ff6203dd357f5b00c50e92b3ad782327 | |
parent | d6d5e7ffff7baabc274200d6e4db7730e44318a5 (diff) | |
download | kutter-f3a38d53819e2cc9ba2587dddde458d1d64b26ea.tar.gz kutter-f3a38d53819e2cc9ba2587dddde458d1d64b26ea.tar.xz kutter-f3a38d53819e2cc9ba2587dddde458d1d64b26ea.zip |
Don't require an existing saved config
-rw-r--r-- | klippy/configfile.py | 5 |
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" |