From aa2fc5af5333d2a682036aed44ba963aec31b5b5 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Tue, 4 May 2004 05:58:03 +0000 Subject: [PATCH] Make CommandGenerationAction able to handle subsidiary actions with no strfunction() method. git-svn-id: http://scons.tigris.org/svn/scons/trunk@968 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- 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 c95644ae..c8d62cd7 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 b3d7e8c8..f699e61f 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 """ -- 2.26.2