Bug #230579 - Handle EOFError raised from cPickle.load() in
authorZac Medico <zmedico@gentoo.org>
Thu, 3 Jul 2008 21:52:56 +0000 (21:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 3 Jul 2008 21:52:56 +0000 (21:52 -0000)
PreservedLibsRegistry.load().

svn path=/main/trunk/; revision=10915

pym/portage/dbapi/vartree.py

index 095d299012c4710a4483f1f12079997ca04bf0e2..f2761d63f6fa252cceef0f17fe9e5aaf00ab7ba7 100644 (file)
@@ -52,8 +52,8 @@ class PreservedLibsRegistry(object):
                """ Reload the registry data from file """
                try:
                        self._data = cPickle.load(open(self._filename, "r"))
-               except IOError, e:
-                       if e.errno == errno.ENOENT:
+               except (EOFError, IOError), e:
+                       if isintance(e, EOFError) or e.errno == errno.ENOENT:
                                self._data = {}
                        elif e.errno == PermissionDenied.errno:
                                raise PermissionDenied(self._filename)