diff --git a/utils.py b/utils.py index 0e697fb..3bd95b4 100644 --- a/utils.py +++ b/utils.py @@ -44,10 +44,13 @@ def remove_deselected_files(): def needs_update(src, out): mtime_src = os.lstat(src).st_mtime - mtime_out = os.lstat(out).st_mtime + if os.path.exists(out) + mtime_out = os.lstat(out).st_mtime + else: + mtime_out = 0 #print("compare", src, out) #print("ts", mtime_src, mtime_out, mtime_src > mtime_out) - if not os.path.exists(out) or mtime_src > mtime_out: + if mtime_src > mtime_out: return True return False