From c21e39b15845a1ad36bd8e4675fcaa7027021df3 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Mon, 3 Jul 2017 21:36:11 +0300 Subject: [PATCH] bug fixes for updates --- toxygen/updater.py | 8 ++++++-- toxygen/util.py | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/toxygen/updater.py b/toxygen/updater.py index ba5d1c9..762892a 100644 --- a/toxygen/updater.py +++ b/toxygen/updater.py @@ -57,7 +57,10 @@ def get_url(version): def get_params(url, version): if is_from_sources(): - return ['python3', 'toxygen_updater.py', url, version] + if platform.system() == 'Windows': + return ['python', 'toxygen_updater.py', url, version] + else: + return ['python3', 'toxygen_updater.py', url, version] elif platform.system() == 'Windows': return [util.curr_directory() + '/toxygen_updater.exe', url, version] else: @@ -87,7 +90,8 @@ def send_request(version): netman.setProxy(proxy) url = test_url(version) try: - request = QtNetwork.QNetworkRequest(url) + request = QtNetwork.QNetworkRequest() + request.setUrl(QtCore.QUrl(url)) reply = netman.get(request) while not reply.isFinished(): QtCore.QThread.msleep(1) diff --git a/toxygen/util.py b/toxygen/util.py index df33998..2183f4a 100644 --- a/toxygen/util.py +++ b/toxygen/util.py @@ -22,8 +22,11 @@ def cached(func): def log(data): - with open(curr_directory() + '/logs.log', 'a') as fl: - fl.write(str(data) + '\n') + try: + with open(curr_directory() + '/logs.log', 'a') as fl: + fl.write(str(data) + '\n') + except: + pass @cached