diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-04-10 16:42:42 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-04-10 16:42:42 +0200 |
commit | 2b4e62c8dacc53317d63d987c4a8826a38bbf9aa (patch) | |
tree | 2ec174254744787d91ee83de5c49c8ab9309937e /engine/SCons/dblite.py | |
parent | 5ee29f69a1062eaa564b19dff870c13f9f8445df (diff) | |
parent | 70639bffe44444b5faee83772cc3c73dc2e46fed (diff) |
Merge tag 'upstream/2.5.0'
Upstream version 2.5.0
Diffstat (limited to 'engine/SCons/dblite.py')
-rw-r--r-- | engine/SCons/dblite.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/SCons/dblite.py b/engine/SCons/dblite.py index f4ba90a..707a4f8 100644 --- a/engine/SCons/dblite.py +++ b/engine/SCons/dblite.py @@ -3,7 +3,6 @@ import SCons.compat -import builtins import os # compat layer imports "cPickle" for us if it's available. import pickle @@ -44,7 +43,7 @@ class dblite(object): # See the discussion at: # http://mail.python.org/pipermail/python-bugs-list/2003-March/016877.html - _open = builtins.open + _open = open _pickle_dump = staticmethod(pickle.dump) _os_chmod = os.chmod try: @@ -99,7 +98,10 @@ class dblite(object): if (len(p) > 0): try: self._dict = pickle.loads(p) - except (pickle.UnpicklingError, EOFError): + except (pickle.UnpicklingError, EOFError, KeyError): + # Note how we catch KeyErrors too here, which might happen + # when we don't have cPickle available (default pickle + # throws it). if (ignore_corrupt_dbfiles == 0): raise if (ignore_corrupt_dbfiles == 1): corruption_warning(self._file_name) |