aboutsummaryrefslogtreecommitdiffstats
path: root/pycrctrl.py
diff options
context:
space:
mode:
authorFulgen301 <tokmajigeorge@gmail.com>2017-08-16 18:23:07 +0200
committerFulgen301 <tokmajigeorge@gmail.com>2017-08-16 18:23:07 +0200
commit222d96a9bfcd8002c6e3b76efdba731dbbcdedda (patch)
tree38c15711ee899982167071cc7f69448961552582 /pycrctrl.py
parent6af848ee046c660116ebe34d0053471eced4ac10 (diff)
downloadpycrctrl-222d96a9bfcd8002c6e3b76efdba731dbbcdedda.tar.gz
pycrctrl-222d96a9bfcd8002c6e3b76efdba731dbbcdedda.zip
Updater: Fix failure if snapshot.id file does not exist
Diffstat (limited to 'pycrctrl.py')
-rw-r--r--pycrctrl.py8
1 files changed, 6 insertions, 2 deletions
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