Make Action() and env.Action() equivalent.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 8 Jan 2004 06:06:09 +0000 (06:06 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 8 Jan 2004 06:06:09 +0000 (06:06 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@871 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Environment.py
src/engine/SCons/EnvironmentTests.py

index 249b0787aa84198fb0b910d522017251ad4a7275..222e0eb6879fde0ece1705c9b0b15d01500d013c 100644 (file)
@@ -109,6 +109,9 @@ RELEASE 0.95 - XXX
 
   - Fix calling Configure() from more than one subsidiary SConscript file.
 
+  - Fix the env.Action() method so it returns the correct type of
+    Action for its argument(s).
+
   From Vincent Risi:
 
   - Add support for the bcc32, ilink32 and tlib Borland tools.
index 6afa69f40869a525a816349dbe73553b5ae3b2c5..02f2f33f8786e2f93386b438cc56244464f25f44 100644 (file)
@@ -702,7 +702,7 @@ class Base:
     #######################################################################
 
     def Action(self, *args, **kw):
-        nargs = self.subst_list(args)
+        nargs = self.subst(args)
         nkw = self.subst_kw(kw)
         return apply(SCons.Action.Action, nargs, nkw)
 
index 778b2f85abb0776c8056b994ac0d6a61d0bda116..4e0b3809aca05829fd92ef48fc4cbb74bffa0263 100644 (file)
@@ -1252,21 +1252,27 @@ class EnvironmentTestCase(unittest.TestCase):
 
     def test_Action(self):
         """Test the Action() method"""
+        import SCons.Action
+
         env = Environment(FOO = 'xyzzy')
 
         a = env.Action('foo')
         assert a, a
+        assert a.__class__ is SCons.Action.CommandAction, a
 
         a = env.Action('$FOO')
         assert a, a
+        assert a.__class__ is SCons.Action.CommandGeneratorAction, a
 
         a = env.Action(['$FOO', 'foo'])
         assert a, a
+        assert a.__class__ is SCons.Action.ListAction, a
 
         def func(arg):
             pass
         a = env.Action(func)
         assert a, a
+        assert a.__class__ is SCons.Action.FunctionAction, a
 
     def test_AddPostAction(self):
         """Test the AddPostAction() method"""