mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
yet another file locking bug: must close prefs.db before moving
This commit is contained in:
parent
bbefeb0cfd
commit
1099b743b7
1 changed files with 5 additions and 0 deletions
|
@ -231,6 +231,11 @@ and no other programs are accessing your profile folders, then try again."""))
|
|||
new = not os.path.exists(path)
|
||||
def recover():
|
||||
# if we can't load profile, start with a new one
|
||||
if self.db:
|
||||
try:
|
||||
self.db.close()
|
||||
except:
|
||||
pass
|
||||
broken = path+".broken"
|
||||
if os.path.exists(broken):
|
||||
os.unlink(broken)
|
||||
|
|
Loading…
Reference in a new issue