From 81ad3bdcdca5e1a17bae2319eb2be5db1f579e8f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 1 Aug 2016 15:10:23 +0200 Subject: [PATCH] appveyor: Try to re-download PyQt on failure --- scripts/dev/ci/appveyor_install.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/dev/ci/appveyor_install.py b/scripts/dev/ci/appveyor_install.py index 5bc87c59e..d6ce4dd48 100644 --- a/scripts/dev/ci/appveyor_install.py +++ b/scripts/dev/ci/appveyor_install.py @@ -28,6 +28,7 @@ CI machines. from __future__ import print_function +import time import subprocess import urllib @@ -49,7 +50,13 @@ pyqt_version = '5.5.1' pyqt_url = ('http://www.qutebrowser.org/pyqt/' 'PyQt5-{}-gpl-Py3.4-Qt{}-x32.exe'.format( pyqt_version, qt_version)) -urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') + +try: + urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') +except OSError: + print("Downloading PyQt failed, trying again in 10 seconds...") + time.sleep(10) + urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') print("Installing PyQt5...") subprocess.check_call([r'C:\install-PyQt5.exe', '/S'])