don't crash when encountering bad marshal data
This commit is contained in:
parent
0f9431fb18
commit
924e18e0b8
|
@ -50,7 +50,8 @@ class PrefFile(PrefObject):
|
||||||
self._prefsdict = {}
|
self._prefsdict = {}
|
||||||
try:
|
try:
|
||||||
prefdict = marshal.load(open(self.__path, 'rb'))
|
prefdict = marshal.load(open(self.__path, 'rb'))
|
||||||
except IOError:
|
except (IOError, ValueError):
|
||||||
|
# file not found, or currupt marshal data
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for key, value in prefdict.items():
|
for key, value in prefdict.items():
|
||||||
|
|
Loading…
Reference in New Issue