summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Sig
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Sig')
-rw-r--r--src/engine/SCons/Sig/__init__.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py
index dfddf34..a2ebd5c 100644
--- a/src/engine/SCons/Sig/__init__.py
+++ b/src/engine/SCons/Sig/__init__.py
@@ -117,7 +117,7 @@ class _SConsign:
"""
try:
return self.entries[filename]
- except:
+ except (KeyError, AttributeError):
return SConsignEntry()
def set_entry(self, filename, entry):
@@ -198,6 +198,8 @@ class SConsignDB(_SConsign):
if type(self.entries) is not type({}):
self.entries = {}
raise TypeError
+ except KeyboardInterrupt:
+ raise
except:
SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,
"Ignoring corrupt sconsign entry : %s"%self.dir.path)
@@ -244,11 +246,13 @@ class SConsignDirFile(SConsignDir):
try:
fp = open(self.sconsign, 'rb')
- except:
+ except IOError:
fp = None
try:
SConsignDir.__init__(self, fp, module)
+ except KeyboardInterrupt:
+ raise
except:
SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning,
"Ignoring corrupt .sconsign file: %s"%self.sconsign)
@@ -274,11 +278,11 @@ class SConsignDirFile(SConsignDir):
try:
file = open(temp, 'wb')
fname = temp
- except:
+ except IOError:
try:
file = open(self.sconsign, 'wb')
fname = self.sconsign
- except:
+ except IOError:
return
cPickle.dump(self.entries, file, 1)
file.close()
@@ -287,16 +291,16 @@ class SConsignDirFile(SConsignDir):
mode = os.stat(self.sconsign)[0]
os.chmod(self.sconsign, 0666)
os.unlink(self.sconsign)
- except:
+ except OSError:
pass
try:
os.rename(fname, self.sconsign)
- except:
+ except OSError:
open(self.sconsign, 'wb').write(open(fname, 'rb').read())
os.chmod(self.sconsign, mode)
try:
os.unlink(temp)
- except:
+ except OSError:
pass
SConsignForDirectory = SConsignDirFile