summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-05-04 05:58:03 (GMT)
committerSteven Knight <knight@baldmt.com>2004-05-04 05:58:03 (GMT)
commitbde114d6bf2c4c5c868be1c09738d701b41e3560 (patch)
treeb3513c2c1c0817ee9aa5a8eb136cc3943c1e4325 /src
parent3fef0c7ddcea8790e9ff097036101450781ec906 (diff)
downloadSCons-bde114d6bf2c4c5c868be1c09738d701b41e3560.zip
SCons-bde114d6bf2c4c5c868be1c09738d701b41e3560.tar.gz
SCons-bde114d6bf2c4c5c868be1c09738d701b41e3560.tar.bz2
Make CommandGenerationAction able to handle subsidiary actions with no strfunction() method.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Action.py5
-rw-r--r--src/engine/SCons/ActionTests.py7
2 files changed, 11 insertions, 1 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index c95644a..c8d62cd 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -412,7 +412,10 @@ class CommandGeneratorAction(ActionBase):
source = [source]
rsources = map(rfile, source)
act = self.__generate(target, source, env, 0)
- return act.strfunction(target, rsources, env)
+ if act.strfunction:
+ return act.strfunction(target, rsources, env)
+ else:
+ return None
def __str__(self):
try:
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py
index b3d7e8c..f699e61 100644
--- a/src/engine/SCons/ActionTests.py
+++ b/src/engine/SCons/ActionTests.py
@@ -1006,6 +1006,13 @@ class CommandGeneratorActionTestCase(unittest.TestCase):
s = a.strfunction([], [], env=Environment())
assert s == "sf was called", s
+ def f(target, source, env, for_signature, self=self):
+ def null(target, source, env):
+ pass
+ return SCons.Action.Action(null, strfunction=None)
+ a = SCons.Action.CommandGeneratorAction(f)
+ s = a.strfunction([], [], env=Environment())
+
def test_execute(self):
"""Test executing a command generator Action
"""