Make CommandGenerationAction able to handle subsidiary actions with no strfunction...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 4 May 2004 05:58:03 +0000 (05:58 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 4 May 2004 05:58:03 +0000 (05:58 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@968 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Action.py
src/engine/SCons/ActionTests.py

index c95644aed984202804436b3b8b43b064a292b403..c8d62cd71b03ce93b2b5d2b8a2f74289cb9746a1 100644 (file)
@@ -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:
index b3d7e8c818a2ecdfddffcdc38561beee0fe57ca4..f699e61fa8c9f9e79eeae3c6c27badc79cc68ed4 100644 (file)
@@ -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
         """