From d25f243c61f4691dcf6dc212437ca0f3ec2b7de0 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 8 Jan 2004 06:06:09 +0000 Subject: Make Action() and env.Action() equivalent. --- 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 249b078..222e0eb 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 6afa69f..02f2f33 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 778b2f8..4e0b380 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""" -- cgit v0.12