diff options
author | Steven Knight <knight@baldmt.com> | 2002-06-05 02:51:24 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-06-05 02:51:24 (GMT) |
commit | 549e4f245d3dd789fa7eef16e43299a4766ec2cd (patch) | |
tree | cef7ecc0a93ad4d29a4189551f77e85b960c414a /src/engine/SCons/Sig | |
parent | 78d38667226c4e01ea8d3b1026b2d6db5492d75b (diff) | |
download | SCons-549e4f245d3dd789fa7eef16e43299a4766ec2cd.zip SCons-549e4f245d3dd789fa7eef16e43299a4766ec2cd.tar.gz SCons-549e4f245d3dd789fa7eef16e43299a4766ec2cd.tar.bz2 |
Fix --implicit-cache if the scanner returns an empty list. (Jeff Petkau)
Diffstat (limited to 'src/engine/SCons/Sig')
-rw-r--r-- | src/engine/SCons/Sig/SigTests.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Sig/__init__.py | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/engine/SCons/Sig/SigTests.py b/src/engine/SCons/Sig/SigTests.py index 1004e6e..7931947 100644 --- a/src/engine/SCons/Sig/SigTests.py +++ b/src/engine/SCons/Sig/SigTests.py @@ -495,6 +495,13 @@ class SConsignEntryTestCase(unittest.TestCase): assert e.get_implicit() == ['foo bletch', 'bar'] assert e.render(m) == "123 456 789 foo bletch\0bar" + e = SCons.Sig.SConsignEntry(m, "987 654 321") + assert e.timestamp == 987 + assert e.bsig == 654 + assert e.csig == 321 + assert e.get_implicit() == [] + assert e.render(m) == "987 654 321 " # note trailing space + class SConsignFileTestCase(unittest.TestCase): def runTest(self): diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 2c8edad..a13557a 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -61,8 +61,9 @@ class SConsignEntry: if arr[2] == '-': self.csig = None else: self.csig = module.from_string(arr[2]) - if arr[3] == '-': self.implicit = None - else: self.implicit = arr[3] + if len(arr) < 4: self.implicit = '' + elif arr[3] == '-': self.implicit = None + else: self.implicit = arr[3] except IndexError: pass @@ -82,8 +83,10 @@ class SConsignEntry: return '%s %s %s %s' % (timestamp, bsig, csig, implicit) def get_implicit(self): - if not self.implicit: + if self.implicit is None: return None + elif self.implicit == '': + return [] else: return string.split(self.implicit, '\0') |