diff options
author | Steven Knight <knight@baldmt.com> | 2002-08-05 04:05:13 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-08-05 04:05:13 (GMT) |
commit | 30e7b8895dff89607f971face4e68fa8f38bfcb3 (patch) | |
tree | b10dbfe3f0b036f8b731bc5556d91e4bac43f881 /src/engine/SCons/Sig | |
parent | 711e5cdfe154688814d7f493cc2c832c79fd1014 (diff) | |
download | SCons-30e7b8895dff89607f971face4e68fa8f38bfcb3.zip SCons-30e7b8895dff89607f971face4e68fa8f38bfcb3.tar.gz SCons-30e7b8895dff89607f971face4e68fa8f38bfcb3.tar.bz2 |
Add a decent error message for corrupted .sconsign files (Bug 579666). (Anthony Roach)
Diffstat (limited to 'src/engine/SCons/Sig')
-rw-r--r-- | src/engine/SCons/Sig/__init__.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 7739aad..b6a5c25 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -34,6 +34,7 @@ import os.path import string import SCons.Node import time +import SCons.Warnings #XXX Get rid of the global array so this becomes re-entrant. sig_files = [] @@ -131,9 +132,14 @@ class SConsignFile: pass else: for line in file.readlines(): - filename, rest = map(string.strip, string.split(line, ":", 1)) - self.entries[filename] = SConsignEntry(self.module, rest) - + try: + filename, rest = map(string.strip, string.split(line, ":", 1)) + self.entries[filename] = SConsignEntry(self.module, rest) + except ValueError: + SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, + "Ignoring corrupt .sconsign file: %s"%self.sconsign) + self.entries = {} + global sig_files sig_files.append(self) |