Allow the exported variables in an SConscript() call to be a UserList, too.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 10 Feb 2002 12:58:31 +0000 (12:58 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 10 Feb 2002 12:58:31 +0000 (12:58 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@253 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Script/SConscript.py
test/SConscript.py

index bb2c7adfbceaafcad8727a89e37ba9f331a29ee2..e77074ad44a296d741a36be688e470fa6f0174cd 100644 (file)
@@ -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.
index de767ef3256e60b363e5ddcb1cc52bf20f2edca1..7210bed646a86f1b6b62b4bb1e861b669c0f5bf2 100644 (file)
@@ -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:
index b60037f42da0beac61f9c8bc2affca21af35e9c4..d9c7748c5b0b95cdef99d04e81badcc6527fb669 100644 (file)
@@ -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))