Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def download(url: str, dst: str) -> None:
"""Download the file at the given URL `url` to the file with path `dst`."""
response = requests.get(url, stream=True)
response.raise_for_status() # raise a meaningful (?) exception if there was e.g. a 404 error
os.makedirs(os.path.dirname(dst), exist_ok=True)
with open(dst, "wb") as f:
for chunk in response.raw.stream(16384, decode_content=False):
if chunk:
Expand Down
Loading