don't crash when encountering bad marshal data

This commit is contained in:
Just van Rossum 2001-07-05 07:03:16 +00:00
parent 0f9431fb18
commit 924e18e0b8
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ class PrefFile(PrefObject):
self._prefsdict = {}
try:
prefdict = marshal.load(open(self.__path, 'rb'))
except IOError:
except (IOError, ValueError):
# file not found, or currupt marshal data
pass
else:
for key, value in prefdict.items():