diff --git a/relenv/fetch.py b/relenv/fetch.py index b6b76a99..75f9b368 100644 --- a/relenv/fetch.py +++ b/relenv/fetch.py @@ -51,16 +51,15 @@ def fetch(version, triplet, python, check_hosts=CHECK_HOSTS): """ Fetch the specified python build. """ - try: - url = f"https://github.com/saltstack/relenv/releases/download/v{version}/{python}-{triplet}.tar.xz" - if not check_url(url, timeout=5): - for host in check_hosts: - url = f"https://{host}/relenv/{version}/build/{python}-{triplet}.tar.xz" - if check_url(url, timeout=5): - break - else: - print(f"Unable to find file on any hosts {' '.join(check_hosts)}") - sys.exit(1) + url = f"https://github.com/saltstack/relenv/releases/download/v{version}/{python}-{triplet}.tar.xz" + if not check_url(url, timeout=5): + for host in check_hosts: + url = f"https://{host}/relenv/{version}/build/{python}-{triplet}.tar.xz" + if check_url(url, timeout=5): + break + else: + print(f"Unable to find file on any hosts {' '.join(check_hosts)}") + sys.exit(1) builddir = work_dir("build", DATA_DIR) os.makedirs(builddir, exist_ok=True) download_url(url, builddir)