Skip to content

Commit 795f466

Browse files
Restore get_externals
1 parent a21cb31 commit 795f466

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

PCbuild/get_external.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
import zipfile
1212

1313

14-
def retrieve_with_retries(download_location, output_path, reporthook, max_retries=7):
15-
"""Download a file with retries."""
14+
def retrieve_with_retries(download_location, output_path, reporthook,
15+
max_retries=7):
16+
"""Download a file with exponential backoff retry and save to disk."""
1617
for attempt in range(max_retries + 1):
1718
try:
1819
resp = urllib.request.urlretrieve(
1920
download_location,
2021
output_path,
21-
reporthook,
22+
reporthook = reporthook,
2223
)
2324
except (urllib.error.URLError, ConnectionError) as ex:
2425
if attempt == max_retries:
@@ -27,7 +28,7 @@ def retrieve_with_retries(download_location, output_path, reporthook, max_retrie
2728
else:
2829
return resp
2930

30-
def fetch_zip(commit_hash, zip_dir, *, org='python', binary=False, verbose=False):
31+
def fetch_zip(commit_hash, zip_dir, *, org='python', binary=False, verbose):
3132
repo = 'cpython-bin-deps' if binary else 'cpython-source-deps'
3233
url = f'https://github.com/{org}/{repo}/archive/{commit_hash}.zip'
3334
reporthook = None

0 commit comments

Comments
 (0)