]> git.lizzy.rs Git - rust.git/commitdiff
be more robust when removing download artifacts and remove bogus raise statement
authorBenjamin Peterson <benjamin@python.org>
Wed, 13 Nov 2013 17:02:50 +0000 (12:02 -0500)
committerBenjamin Peterson <benjamin@python.org>
Wed, 13 Nov 2013 17:02:50 +0000 (12:02 -0500)
src/etc/snapshot.py

index e7057defd7750951a85e7f662811818d3900c1e5..99193d905f87fdabb5bdaa98d54fa9093ae2765b 100644 (file)
@@ -148,8 +148,11 @@ def get_url_to_file(u,f):
         returncode = subprocess.call(["wget", "-O", tmpf, u])
 
     if returncode != 0:
-        os.unlink(tmpf)
-        raise
+        try:
+            os.unlink(tmpf)
+        except OSError as e:
+            pass
+        raise Exception("failed to fetch url")
     os.rename(tmpf, f)
 
 def snap_filename_hash_part(snap):