don't set modtime of 0

This commit is contained in:
Damien Elmes 2010-02-06 01:20:50 +09:00
parent c659660864
commit dfd88cc4c1

View file

@ -3381,7 +3381,8 @@ nextFactor, reps, thinkingTime, yesCount, noCount from reviewHistory""")
re.sub("\.anki$", ".backup-%s.anki" % n, escp))) re.sub("\.anki$", ".backup-%s.anki" % n, escp)))
shutil.copy2(path, newpath) shutil.copy2(path, newpath)
# set mtimes to be identical # set mtimes to be identical
os.utime(newpath, (deck.modified, deck.modified)) if deck.modified:
os.utime(newpath, (deck.modified, deck.modified))
# remove if over # remove if over
if len(backups) + 1 > numBackups: if len(backups) + 1 > numBackups:
delete = len(backups) + 1 - numBackups delete = len(backups) + 1 - numBackups