fix for empty yesterday-file

This commit is contained in:
Jakobus Schürz 2020-10-11 17:21:43 +02:00
parent 57611fa5fc
commit 1795317d9c

View file

@ -95,7 +95,11 @@ class WorkdirFS(Operations):
def _give_me_yesterday(self): def _give_me_yesterday(self):
if os.path.exists(self.configlast): if os.path.exists(self.configlast):
with open(self.configlast, 'r') as fh: with open(self.configlast, 'r') as fh:
self.yesterday = datetime.strptime(fh.readline().strip(), "%Y-%m-%d") yesterday = fh.readline().strip()
if self.yesterday == None:
self.yesterday = self.today
else:
self.yesterday = datetime.strptime(yesterday, "%Y-%m-%d")
else: else:
self.yesterday = self.today self.yesterday = self.today
self._checkdir(self.confdir) self._checkdir(self.confdir)