From: stevenknight Date: Wed, 29 Sep 2004 12:06:20 +0000 (+0000) Subject: Fix use of a list of SConscript files when calling env.SConscript(). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4dbfb63d69bb7afd570fd91138b1250e135f4e3a;p=scons.git Fix use of a list of SConscript files when calling env.SConscript(). git-svn-id: http://scons.tigris.org/svn/scons/trunk@1110 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 15be7db4..d538b125 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -82,6 +82,9 @@ RELEASE 0.97 - XXX - On Win32, install scons.bat in the Python directory when installing from setup.py. (The bdist_wininst installer was already doing this.) + - Fix env.SConscript() when called with a list of SConscipt files. + (The SConscript() global function already worked properly.) + From Clive Levinson: - Make ParseConfig() recognize and add -mno-cygwin to $LINKFLAGS and diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 88d32684..6adb399a 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -495,7 +495,13 @@ class SConsEnvironment(SCons.Environment.Base): raise SCons.Errors.UserError, "Import of non-existent variable '%s'"%x def SConscript(self, *ls, **kw): - ls = map(lambda l, self=self: self.subst(l), ls) + def subst_element(x, subst=self.subst): + if SCons.Util.is_List(x): + x = map(subst, x) + else: + x = subst(x) + return x + ls = map(subst_element, ls) subst_kw = {} for key, val in kw.items(): if SCons.Util.is_String(val): diff --git a/test/SConscript.py b/test/SConscript.py index e70fb362..4aaed3ba 100644 --- a/test/SConscript.py +++ b/test/SConscript.py @@ -374,6 +374,8 @@ y = 'yyy' env.Export(["x", "y"]) env.SConscript('$SUB1/SConscript') env.SConscript(dirs=['$SUB2']) +SConscript(['s1', 's2']) +env.SConscript(['s3', 's4']) """) test.write(['sub1', 'SConscript'], """\ @@ -390,6 +392,11 @@ print "sub2/SConscript" print "y =", y """) +test.write('s1', "\n") +test.write('s2', "\n") +test.write('s3', "\n") +test.write('s4', "\n") + expect = """\ SConstruct sub1/SConscript