diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-07-31 13:17:44 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-07-31 13:30:58 +0200 |
commit | a52aff5028dd3d786154d4dc3229f5735707a3d4 (patch) | |
tree | a0f56a3f93fccc6316283904abb32db3f0f03cde | |
parent | 408f962cb26936ae282bbee31f682784da73ab08 (diff) |
download_orig: unlink file before raising the exception
otherwise we would not clean up
-rw-r--r-- | gbp/scripts/common/import_orig.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gbp/scripts/common/import_orig.py b/gbp/scripts/common/import_orig.py index b2f45bb6..24a56f10 100644 --- a/gbp/scripts/common/import_orig.py +++ b/gbp/scripts/common/import_orig.py @@ -171,8 +171,8 @@ def download_orig(url): for d in r.iter_content(CHUNK_SIZE): target_fd.write(d) except Exception as e: - raise GbpError("Failed to download %s: %s" % (url, e)) if os.path.exists(target): os.unlink(target) + raise GbpError("Failed to download %s: %s" % (url, e)) return DebianUpstreamSource(target) |