From: stevenknight Date: Wed, 5 Jun 2002 02:51:24 +0000 (+0000) Subject: Fix --implicit-cache if the scanner returns an empty list. (Jeff Petkau) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7586eeb3457fd9f497c5b5393952bba7e8a0ff41;p=scons.git Fix --implicit-cache if the scanner returns an empty list. (Jeff Petkau) git-svn-id: http://scons.tigris.org/svn/scons/trunk@381 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index db75777d..0d8e4750 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -54,6 +54,10 @@ RELEASE 0.08 - - Added a --debug=time option to print SCons execution times. + From Jeff Petkau: + + - Fix --implicit-cache if the scanner returns an empty list. + From Zed Shaw: - Add an Append() method to Environments, to append values to diff --git a/src/engine/SCons/Sig/SigTests.py b/src/engine/SCons/Sig/SigTests.py index 1004e6e3..7931947e 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 2c8edada..a13557af 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')