mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make newer() robust against missing source files
This commit is contained in:
parent
839f977566
commit
fed1d1b313
@ -47,8 +47,12 @@ def newer(targets, sources):
|
||||
if not os.path.exists(f):
|
||||
return True
|
||||
ttimes = map(lambda x: os.stat(x).st_mtime, targets)
|
||||
oldest_target = max(ttimes)
|
||||
try:
|
||||
stimes = map(lambda x: os.stat(x).st_mtime, sources)
|
||||
newest_source, oldest_target = max(stimes), min(ttimes)
|
||||
newest_source = max(stimes)
|
||||
except FileNotFoundError:
|
||||
newest_source = oldest_target +1
|
||||
return newest_source > oldest_target
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user