diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-05-26 23:22:15 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-05-26 23:22:15 +0000 |
commit | 1a476ed1c00203b4ac613b85b79fa5b3e41a0ea9 (patch) | |
tree | 4a3309b9fda6055c4594c277d6eacf4b0097dda0 | |
parent | 2f43386bd8d07d855388b9e8b759b76f7ccc9933 (diff) | |
download | portage-1a476ed1c00203b4ac613b85b79fa5b3e41a0ea9.tar.gz portage-1a476ed1c00203b4ac613b85b79fa5b3e41a0ea9.tar.bz2 portage-1a476ed1c00203b4ac613b85b79fa5b3e41a0ea9.zip |
Don't silently swallow instances of UnpicklingError since they are easily
triggered by storing instances of custom classes in a pickle.
svn path=/main/trunk/; revision=10434
-rw-r--r-- | pym/portage/dbapi/vartree.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 69b1512ef..428e3d24e 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -602,8 +602,11 @@ class vardbapi(dbapi): self._aux_cache = mypickle.load() f.close() del f - except (IOError, OSError, EOFError, cPickle.UnpicklingError): - pass + except (IOError, OSError, EOFError, cPickle.UnpicklingError), e: + if isinstance(e, cPickle.UnpicklingError): + writemsg("!!! Error loading '%s': %s\n" % \ + (self._aux_cache_filename, str(e)), noiselevel=-1) + del e if not self._aux_cache or \ not isinstance(self._aux_cache, dict) or \ self._aux_cache.get("version") != self._aux_cache_version or \ |