mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix a problem saving over a deck with an existing media folder
This commit is contained in:
parent
f1a2fc7feb
commit
daeba6f78b
1 changed files with 7 additions and 2 deletions
|
@ -1369,8 +1369,13 @@ Return new path, relative to media dir."""
|
|||
assert os.path.exists(oldPath)
|
||||
newPath = self.mediaDir(create=True)
|
||||
# copytree doesn't want the dir to exist
|
||||
os.rmdir(newPath)
|
||||
shutil.copytree(oldPath, newPath)
|
||||
try:
|
||||
os.rmdir(newPath)
|
||||
shutil.copytree(oldPath, newPath)
|
||||
except:
|
||||
# FIXME: should really remove everything in old dir instead of
|
||||
# giving up
|
||||
pass
|
||||
|
||||
# DB helpers
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue