diff options
| author | Steven Knight <knight@baldmt.com> | 2002-02-10 12:58:31 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2002-02-10 12:58:31 (GMT) |
| commit | fb0bf9a521b17a2cdcc0530cf443ebe12ccae1a4 (patch) | |
| tree | 603c68523d5c9a324524c29c46a86a5de2853b10 | |
| parent | e61588a4fbb9ffb27d04b1215dc2558ee38612b9 (diff) | |
| download | SCons-fb0bf9a521b17a2cdcc0530cf443ebe12ccae1a4.zip SCons-fb0bf9a521b17a2cdcc0530cf443ebe12ccae1a4.tar.gz SCons-fb0bf9a521b17a2cdcc0530cf443ebe12ccae1a4.tar.bz2 | |
Allow the exported variables in an SConscript() call to be a UserList, too.
| -rw-r--r-- | src/CHANGES.txt | 3 | ||||
| -rw-r--r-- | src/engine/SCons/Script/SConscript.py | 10 | ||||
| -rw-r--r-- | test/SConscript.py | 16 |
3 files changed, 24 insertions, 5 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index bb2c7ad..e77074a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -50,6 +50,9 @@ RELEASE 0.05 - - WIN32 portability fixes in tests. + - Allow the list of variables exported to an SConscript file to be + a UserList, too. + From Anthony Roach: - Make the scons script return an error code on failures. diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index de767ef..7210bed 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -28,14 +28,16 @@ files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/SConscript.py __REVISION__ __DATE__ __DEVELOPER__" +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.Errors import SCons.Builder import SCons.Defaults +import SCons.Environment +import SCons.Errors import SCons.Node import SCons.Node.FS -import SCons.Environment +import SCons.Util + import string import sys @@ -61,7 +63,7 @@ class Frame: self.exports = {} # exports from the calling SConscript try: - if type(exports) == type([]): + if SCons.Util.is_List(exports): for export in exports: self.exports[export] = stack[-1].globals[export] else: diff --git a/test/SConscript.py b/test/SConscript.py index b60037f..d9c7748 100644 --- a/test/SConscript.py +++ b/test/SConscript.py @@ -65,6 +65,12 @@ foo = SConscript(script) assert foo == "subdir/SConscript foo" SConscript('SConscript5') + +import UserList +x7 = "SConstruct x7" +x8 = "SConstruct x8" +x9 = SConscript('SConscript6', UserList.UserList(["x7", "x8"])) +assert x9 == "SConscript6 x9" """) test.write('SConscript', """ @@ -87,7 +93,6 @@ Return("x3 x4") """) - test.write('SConscript2', """ Import("x1","x2") assert x1 == "SConstruct x1" @@ -149,6 +154,15 @@ S = Scanner(name = 'S', function = scan) A = Action("A") """) + +test.write('SConscript6', """ +Import("x7 x8") +assert x7 == "SConstruct x7" +assert x8 == "SConstruct x8" +x9 = "SConscript6 x9" +Return("x9") +""") + wpath = test.workpath() test.run(stdout = "SConstruct %s\nSConscript %s\n" % (wpath, wpath)) |
