diff --git a/updater.py b/updater.py index b9ecd86..8c7dddb 100644 --- a/updater.py +++ b/updater.py @@ -1,5 +1,8 @@ -import json, urllib, sys, requests, time, os, platform +import json, sys, requests, time, os, platform, traceback +from io import BytesIO + from PyQt4 import QtGui, QtCore + from game_version import * returncode = -1 @@ -112,8 +115,9 @@ class updateThread(QtCore.QThread): global returncode try: - manifest = json.load(urllib.urlopen("http://api.github.com/repos/headshot2017/AO2XP/releases")) + manifest = json.load(BytesIO(requests.get("http://api.github.com/repos/headshot2017/AO2XP/releases").content)) except: + print traceback.format_exc() self.showMessageBox.emit("critical", "Error", "Failed to check for updates.\nPlease check your internet connection.") self.finished.emit() return