diff options
| author | Fulgen301 <tokmajigeorge@gmail.com> | 2017-08-16 18:23:07 +0200 |
|---|---|---|
| committer | Fulgen301 <tokmajigeorge@gmail.com> | 2017-08-16 18:23:07 +0200 |
| commit | 222d96a9bfcd8002c6e3b76efdba731dbbcdedda (patch) | |
| tree | 38c15711ee899982167071cc7f69448961552582 | |
| parent | 6af848ee046c660116ebe34d0053471eced4ac10 (diff) | |
| download | pycrctrl-222d96a9bfcd8002c6e3b76efdba731dbbcdedda.tar.gz pycrctrl-222d96a9bfcd8002c6e3b76efdba731dbbcdedda.zip | |
Updater: Fix failure if snapshot.id file does not exist
| -rw-r--r-- | pycrctrl.py | 8 |
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 |
