aboutsummaryrefslogtreecommitdiff
path: root/gbp/scripts/common/import_orig.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/common/import_orig.py')
-rw-r--r--gbp/scripts/common/import_orig.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gbp/scripts/common/import_orig.py b/gbp/scripts/common/import_orig.py
index eaa38b77..66144e5b 100644
--- a/gbp/scripts/common/import_orig.py
+++ b/gbp/scripts/common/import_orig.py
@@ -167,7 +167,8 @@ def download_orig(url):
try:
with contextlib.closing(requests.get(url, verify=True, stream=True)) as r:
- with contextlib.closing(open(target, 'w', CHUNK_SIZE)) as target_fd:
+ r.raise_for_status()
+ with open(target, 'w', CHUNK_SIZE) as target_fd:
for d in r.iter_content(CHUNK_SIZE):
target_fd.write(d)
except Exception as e: