From: Zac Medico Date: Thu, 3 Jul 2008 21:52:56 +0000 (-0000) Subject: Bug #230579 - Handle EOFError raised from cPickle.load() in X-Git-Tag: v2.2_rc2~223 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=da4c1e25f54e4da4b2c5c80b5568a0c8c45cae50;p=portage.git Bug #230579 - Handle EOFError raised from cPickle.load() in PreservedLibsRegistry.load(). svn path=/main/trunk/; revision=10915 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 095d29901..f2761d63f 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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)