remove stale journal file when resetting prefs

This commit is contained in:
Damien Elmes 2018-03-22 14:10:23 +10:00
parent bc4178c4d4
commit 6dd7a18667

View file

@ -300,7 +300,10 @@ and no other programs are accessing your profile folders, then try again."""))
self.db.close()
except:
pass
os.unlink(path)
for suffix in ("", "-journal"):
fpath = path + suffix
if os.path.exists(fpath):
os.unlink(fpath)
QMessageBox.warning(
None, "Preferences Corrupt", """\
Anki's prefs21.db file was corrupt and has been recreated. If you were using multiple \