From 222d96a9bfcd8002c6e3b76efdba731dbbcdedda Mon Sep 17 00:00:00 2001 From: Fulgen301 Date: Wed, 16 Aug 2017 18:23:07 +0200 Subject: Updater: Fix failure if snapshot.id file does not exist --- pycrctrl.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pycrctrl.py') diff --git a/pycrctrl.py b/pycrctrl.py index 06dcb92..9361d61 100644 --- a/pycrctrl.py +++ b/pycrctrl.py @@ -77,8 +77,12 @@ class Updater(object): def __init__(self, parent): self.parent = parent - with open(os.path.join(self.parent.path, "snapshot.id"), "rb") as fobj: - self.__current_revision = fobj.read().decode("utf-8") + try: + with open(os.path.join(self.parent.path, "snapshot.id"), "rb") as fobj: + self.__current_revision = fobj.read().decode("utf-8") + except OSError: + pass + start_new_thread(self.checkForUpdates, ()) @property -- cgit v1.2.3-54-g00ecf