[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.45-35-g3633050
Andreas Beckmann
debian at abeckmann.de
Wed Jun 27 20:03:52 UTC 2012
The following commit has been merged in the develop branch:
commit 24ab2f7a34feab0c3099c2f5bc4f1a266533a885
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Mon Jun 25 17:03:59 2012 +0200
logdb: cleanup exception handling
use try/except/finally to cleanup the temp_file once for all branches
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 9c95f52..5751bf1 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -214,10 +214,10 @@ class LogDB:
full_name = os.path.join(subdir, self._log_name(package, version))
try:
os.link(temp_name, full_name)
- except OSError, detail:
- os.remove(temp_name)
+ except OSError:
return False
- os.remove(temp_name)
+ finally:
+ os.remove(temp_name)
self._evict(full_name)
return True
--
piuparts git repository
More information about the Piuparts-commits
mailing list