diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-11 16:45:20 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-02-11 19:31:31 +0000 |
commit | 07997a77c6a6a61c23bb4b1a8a16d07c7aae39fb (patch) | |
tree | 472d9540a57867d585475fa7c38bfb2cf7495091 /build_scripts | |
parent | 1bb4368a420ef12e3714bd4edfff34b8b3c983a8 (diff) |
setup.py: Retry to downloading dependencies
Fix frequent timeouts in COIN.
Change-Id: I2a85fd6a72891a937a758e0f5c38aacdcb83de8f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/utils.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 019090dab..6aafb7588 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -737,11 +737,16 @@ _7z_binary = None def download_and_extract_7z(fileurl, target): """ Downloads 7z file from fileurl and extract to target """ - print("Downloading fileUrl {} ".format(fileurl)) info = "" - try: - localfile, info = urllib.urlretrieve(fileurl) - except: + localfile = None + for i in range(1, 10): + try: + print("Downloading fileUrl {}, attempt #{}".format(fileurl, i)) + localfile, info = urllib.urlretrieve(fileurl) + break + except: + pass + if not localfile: print("Error downloading {} : {}".format(fileurl, info)) raise RuntimeError(' Error downloading {}'.format(fileurl)) |