From 32121631d35d27e6f5133a825fa532012026954b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 18 Mar 2006 21:11:24 +0000 Subject: [PATCH] Prevent an IOError with errno != ENOENT from being swallowed in flat_hash._setitem(). svn path=/main/trunk/; revision=2944 --- pym/cache/flat_hash.py | 10 +++++----- 1 file 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)) -- 2.26.2