diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-03-18 21:11:24 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-03-18 21:11:24 +0000 |
commit | 32121631d35d27e6f5133a825fa532012026954b (patch) | |
tree | e73ee7ce41d0c112632dd81062e89774bb663454 | |
parent | 94ec7a8bb7f087882f6c2b308176e6b4c401c438 (diff) | |
download | portage-32121631d35d27e6f5133a825fa532012026954b.tar.gz portage-32121631d35d27e6f5133a825fa532012026954b.tar.bz2 portage-32121631d35d27e6f5133a825fa532012026954b.zip |
Prevent an IOError with errno != ENOENT from being swallowed in flat_hash._setitem().
svn path=/main/trunk/; revision=2944
-rw-r--r-- | pym/cache/flat_hash.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/cache/flat_hash.py b/pym/cache/flat_hash.py index 605315c6d..8ebd70f7d 100644 --- a/pym/cache/flat_hash.py +++ b/pym/cache/flat_hash.py @@ -70,16 +70,16 @@ class database(fs_template.FsBased): s = cpv.rfind("/") fp = os.path.join(self.location,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:])) try: myf=open(fp, "w") - except IOError, ie: - if errno.ENOENT == ie.errno: + except (IOError, OSError), e: + if errno.ENOENT == e.errno: try: self._ensure_dirs(cpv) myf=open(fp,"w") except (OSError, IOError),e: raise cache_errors.CacheCorruption(cpv, e) - except OSError, e: - raise cache_errors.CacheCorruption(cpv, e) - + else: + raise cache_errors.CacheCorruption(cpv, e) + for k, v in values.items(): if k != "_mtime_" and (k == "_eclasses_" or k in self._known_keys): myf.writelines("%s=%s\n" % (k, v)) |