mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1519855 [restore database without metadata.db present in directory fails](https://bugs.launchpad.net/calibre/+bug/1519855)
This commit is contained in:
parent
c63d75bae4
commit
30c4d00d9b
@ -269,6 +269,7 @@ class Restore(Thread):
|
|||||||
save_path = self.olddb = os.path.splitext(dbpath)[0]+'_pre_restore.db'
|
save_path = self.olddb = os.path.splitext(dbpath)[0]+'_pre_restore.db'
|
||||||
if os.path.exists(save_path):
|
if os.path.exists(save_path):
|
||||||
os.remove(save_path)
|
os.remove(save_path)
|
||||||
|
if os.path.exists(dbpath):
|
||||||
try:
|
try:
|
||||||
os.rename(dbpath, save_path)
|
os.rename(dbpath, save_path)
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user