remove stale journal file when resetting prefs

This commit is contained in:
Damien Elmes 2018-03-22 14:10:23 +10:00
parent 83cc2a6ce8
commit c01ba49168

View File

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