From 241f1ea93bdd02bb3cb31daf94627e2a975409de Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 8 Jan 2004 06:06:09 +0000 Subject: [PATCH] Make Action() and env.Action() equivalent. git-svn-id: http://scons.tigris.org/svn/scons/trunk@871 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 3 +++ src/engine/SCons/Environment.py | 2 +- src/engine/SCons/EnvironmentTests.py | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 249b0787..222e0eb6 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -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. diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 6afa69f4..02f2f33f 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -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) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 778b2f85..4e0b3809 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -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""" -- 2.26.2