mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
don't crash when encountering bad marshal data
This commit is contained in:
parent
0f9431fb18
commit
924e18e0b8
1 changed files with 2 additions and 1 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue