From 2377357f4e0164d338c1249c79f479229aa7c0e4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 28 Sep 2012 19:36:17 -0700 Subject: Handle KeyError when loading pickles. See http://forums.gentoo.org/viewtopic-t-938022.html for example. --- pym/portage/dbapi/vartree.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pym/portage/dbapi') diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index f8980f7a0..5299b298f 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -585,7 +585,9 @@ class vardbapi(dbapi): aux_cache = mypickle.load() f.close() del f - except (AttributeError, EOFError, EnvironmentError, ValueError, pickle.UnpicklingError) as e: + except (SystemExit, KeyboardInterrupt): + raise + except Exception as e: if isinstance(e, EnvironmentError) and \ getattr(e, 'errno', None) in (errno.ENOENT, errno.EACCES): pass -- cgit v1.2.3-1-g7c22