From da4c1e25f54e4da4b2c5c80b5568a0c8c45cae50 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 3 Jul 2008 21:52:56 +0000 Subject: [PATCH] Bug #230579 - Handle EOFError raised from cPickle.load() in PreservedLibsRegistry.load(). svn path=/main/trunk/; revision=10915 --- pym/portage/dbapi/vartree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.26.2