summaryrefslogtreecommitdiffstats
path: root/pym/cache
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-22 22:31:33 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-22 22:31:33 +0000
commitf3343814356566b7738eba2976787e6181598f25 (patch)
tree7de97fcb9d1c580ffee7bbf016f406cd00f3eb62 /pym/cache
parent874e2997ff516ff2daffdce263b47d62dd1af435 (diff)
downloadportage-f3343814356566b7738eba2976787e6181598f25.tar.gz
portage-f3343814356566b7738eba2976787e6181598f25.tar.bz2
portage-f3343814356566b7738eba2976787e6181598f25.zip
Move the open call out of the inner try block.
svn path=/main/trunk/; revision=4506
Diffstat (limited to 'pym/cache')
-rw-r--r--pym/cache/flat_hash.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pym/cache/flat_hash.py b/pym/cache/flat_hash.py
index 90c785f34..1c687ecf3 100644
--- a/pym/cache/flat_hash.py
+++ b/pym/cache/flat_hash.py
@@ -23,15 +23,13 @@ class database(fs_template.FsBased):
def __getitem__(self, cpv):
fp = os.path.join(self.location, cpv)
try:
- myf = None
+ myf = open(fp, "r")
try:
- myf = open(fp,"r")
d = self._parse_data(myf, cpv)
d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
return d
finally:
- if myf:
- myf.close()
+ myf.close()
except (IOError, OSError), e:
if e.errno != errno.ENOENT:
raise cache_errors.CacheCorruption(cpv, e)