Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tusky committed Aug 13, 2018
1 parent 5b2efd9 commit a31675c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ def get_local_version(self):
self.local_version = parse_version(Path('version').read_text().strip())

def get_remote_version(self):
data = requests.get('https://api.github.com/repos/Tusky/KoDiscord/releases/latest').json()
self.download_url = data['assets'][0]['browser_download_url']
self.remote_version = parse_version(data['tag_name'])
try:
data = requests.get('https://api.github.com/repos/Tusky/KoDiscord/releases/latest').json()
except requests.exceptions.ConnectionError:
self.remote_version = self.local_version
else:
self.download_url = data['assets'][0]['browser_download_url']
self.remote_version = parse_version(data['tag_name'])

def is_there_an_update(self):
return self.local_version < self.remote_version
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.2
0.6.3

0 comments on commit a31675c

Please sign in to comment.