]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
don't crash when encountering bad marshal data
authorJust van Rossum <just@letterror.com>
Thu, 5 Jul 2001 07:03:16 +0000 (07:03 +0000)
committerJust van Rossum <just@letterror.com>
Thu, 5 Jul 2001 07:03:16 +0000 (07:03 +0000)
Mac/Tools/IDE/MacPrefs.py

index f8888fcf34f59d52a12712c6e62333d18680cab6..b1fa7cabcc9f5cac79d2b76ee24c94398071a324 100644 (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():