From bde114d6bf2c4c5c868be1c09738d701b41e3560 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Tue, 4 May 2004 05:58:03 +0000 Subject: Make CommandGenerationAction able to handle subsidiary actions with no strfunction() method. --- src/engine/SCons/Action.py | 5 ++++- src/engine/SCons/ActionTests.py | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 """ -- cgit v0.12