Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 924e18e

Browse files
committed
don't crash when encountering bad marshal data
1 parent 0f9431f commit 924e18e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Mac/Tools/IDE/MacPrefs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def __init__(self, path, creator = 'Pyth'):
5050
self._prefsdict = {}
5151
try:
5252
prefdict = marshal.load(open(self.__path, 'rb'))
53-
except IOError:
53+
except (IOError, ValueError):
54+
# file not found, or currupt marshal data
5455
pass
5556
else:
5657
for key, value in prefdict.items():

0 commit comments

Comments
 (0)