Skip to content

Commit

Permalink
Don't fail if output file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke committed May 16, 2021
1 parent 2b7d225 commit ed0ae9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def _parse_remind(self, filename, lines=''):
if 'Unknown option' in process.stderr:
raise OSError(f'Error running: {" ".join(cmd)}, maybe old remind version')

if f"Can't open file: {filename}" in process.stderr:
return {filename: {}}

err = list(set(findall(r"Can't open file: (.*)", process.stderr)))
if err:
raise FileExistsError(f'include file(s): {", ".join(err)} not found (please use absolute paths)')
Expand Down Expand Up @@ -213,7 +216,7 @@ def _update(self):

with self._lock:
for fname in self._reminders:
if getmtime(fname) > self._mtime:
if not isfile(fname) or getmtime(fname) > self._mtime:
update = True
break

Expand Down

0 comments on commit ed0ae9a

Please sign in to comment.