Package SCons :: Package Script :: Module SConscript'
[hide private]
[frames] | no frames]

Source Code for Module SCons.Script.SConscript'

  1  """SCons.Script.SConscript 
  2   
  3  This module defines the Python API provided to SConscript and SConstruct 
  4  files. 
  5   
  6  """ 
  7   
  8  # 
  9  # Copyright (c) 2001 - 2019 The SCons Foundation 
 10  # 
 11  # Permission is hereby granted, free of charge, to any person obtaining 
 12  # a copy of this software and associated documentation files (the 
 13  # "Software"), to deal in the Software without restriction, including 
 14  # without limitation the rights to use, copy, modify, merge, publish, 
 15  # distribute, sublicense, and/or sell copies of the Software, and to 
 16  # permit persons to whom the Software is furnished to do so, subject to 
 17  # the following conditions: 
 18  # 
 19  # The above copyright notice and this permission notice shall be included 
 20  # in all copies or substantial portions of the Software. 
 21  # 
 22  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 
 23  # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
 24  # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 25  # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 
 26  # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
 27  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
 28  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
 29   
 30  __revision__ = "src/engine/SCons/Script/SConscript.py 3a41ed6b288cee8d085373ad7fa02894e1903864 2019-01-23 17:30:35 bdeegan" 
 31   
 32  import SCons 
 33  import SCons.Action 
 34  import SCons.Builder 
 35  import SCons.Defaults 
 36  import SCons.Environment 
 37  import SCons.Errors 
 38  import SCons.Node 
 39  import SCons.Node.Alias 
 40  import SCons.Node.FS 
 41  import SCons.Platform 
 42  import SCons.SConf 
 43  import SCons.Script.Main 
 44  import SCons.Tool 
 45  import SCons.Util 
 46   
 47  from . import Main 
 48   
 49  import collections 
 50  import os 
 51  import os.path 
 52  import re 
 53  import sys 
 54  import traceback 
 55  import time 
 56   
57 -class SConscriptReturn(Exception):
58 pass
59 60 launch_dir = os.path.abspath(os.curdir) 61 62 GlobalDict = None 63 64 # global exports set by Export(): 65 global_exports = {} 66 67 # chdir flag 68 sconscript_chdir = 1 69
70 -def get_calling_namespaces():
71 """Return the locals and globals for the function that called 72 into this module in the current call stack.""" 73 try: 1//0 74 except ZeroDivisionError: 75 # Don't start iterating with the current stack-frame to 76 # prevent creating reference cycles (f_back is safe). 77 frame = sys.exc_info()[2].tb_frame.f_back 78 79 # Find the first frame that *isn't* from this file. This means 80 # that we expect all of the SCons frames that implement an Export() 81 # or SConscript() call to be in this file, so that we can identify 82 # the first non-Script.SConscript frame as the user's local calling 83 # environment, and the locals and globals dictionaries from that 84 # frame as the calling namespaces. See the comment below preceding 85 # the DefaultEnvironmentCall block for even more explanation. 86 while frame.f_globals.get("__name__") == __name__: 87 frame = frame.f_back 88 89 return frame.f_locals, frame.f_globals
90 91
92 -def compute_exports(exports):
93 """Compute a dictionary of exports given one of the parameters 94 to the Export() function or the exports argument to SConscript().""" 95 96 loc, glob = get_calling_namespaces() 97 98 retval = {} 99 try: 100 for export in exports: 101 if SCons.Util.is_Dict(export): 102 retval.update(export) 103 else: 104 try: 105 retval[export] = loc[export] 106 except KeyError: 107 retval[export] = glob[export] 108 except KeyError as x: 109 raise SCons.Errors.UserError("Export of non-existent variable '%s'"%x) 110 111 return retval
112
113 -class Frame(object):
114 """A frame on the SConstruct/SConscript call stack"""
115 - def __init__(self, fs, exports, sconscript):
116 self.globals = BuildDefaultGlobals() 117 self.retval = None 118 self.prev_dir = fs.getcwd() 119 self.exports = compute_exports(exports) # exports from the calling SConscript 120 # make sure the sconscript attr is a Node. 121 if isinstance(sconscript, SCons.Node.Node): 122 self.sconscript = sconscript 123 elif sconscript == '-': 124 self.sconscript = None 125 else: 126 self.sconscript = fs.File(str(sconscript))
127 128 # the SConstruct/SConscript call stack: 129 call_stack = [] 130 131 # For documentation on the methods in this file, see the scons man-page 132
133 -def Return(*vars, **kw):
134 retval = [] 135 try: 136 fvars = SCons.Util.flatten(vars) 137 for var in fvars: 138 for v in var.split(): 139 retval.append(call_stack[-1].globals[v]) 140 except KeyError as x: 141 raise SCons.Errors.UserError("Return of non-existent variable '%s'"%x) 142 143 if len(retval) == 1: 144 call_stack[-1].retval = retval[0] 145 else: 146 call_stack[-1].retval = tuple(retval) 147 148 stop = kw.get('stop', True) 149 150 if stop: 151 raise SConscriptReturn
152 153 154 stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :) 155
156 -def handle_missing_SConscript(f, must_exist=None):
157 """Take appropriate action on missing file in SConscript() call. 158 159 Print a warning or raise an exception on missing file. 160 On first warning, print a deprecation message. 161 162 Args: 163 f (str): path of missing configuration file 164 must_exist (bool): raise exception if file does not exist 165 166 Raises: 167 UserError if 'must_exist' is True or if global 168 SCons.Script._no_missing_sconscript is True. 169 """ 170 171 if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False): 172 msg = "Fatal: missing SConscript '%s'" % f.get_internal_path() 173 raise SCons.Errors.UserError(msg) 174 175 if SCons.Script._warn_missing_sconscript_deprecated: 176 msg = "Calling missing SConscript without error is deprecated.\n" + \ 177 "Transition by adding must_exist=0 to SConscript calls.\n" + \ 178 "Missing SConscript '%s'" % f.get_internal_path() 179 SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg) 180 SCons.Script._warn_missing_sconscript_deprecated = False 181 else: 182 msg = "Ignoring missing SConscript '%s'" % f.get_internal_path() 183 SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
184
185 -def _SConscript(fs, *files, **kw):
186 top = fs.Top 187 sd = fs.SConstruct_dir.rdir() 188 exports = kw.get('exports', []) 189 190 # evaluate each SConscript file 191 results = [] 192 for fn in files: 193 call_stack.append(Frame(fs, exports, fn)) 194 old_sys_path = sys.path 195 try: 196 SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1 197 if fn == "-": 198 exec(sys.stdin.read(), call_stack[-1].globals) 199 else: 200 if isinstance(fn, SCons.Node.Node): 201 f = fn 202 else: 203 f = fs.File(str(fn)) 204 _file_ = None 205 206 # Change directory to the top of the source 207 # tree to make sure the os's cwd and the cwd of 208 # fs match so we can open the SConscript. 209 fs.chdir(top, change_os_dir=1) 210 if f.rexists(): 211 actual = f.rfile() 212 _file_ = open(actual.get_abspath(), "rb") 213 elif f.srcnode().rexists(): 214 actual = f.srcnode().rfile() 215 _file_ = open(actual.get_abspath(), "rb") 216 elif f.has_src_builder(): 217 # The SConscript file apparently exists in a source 218 # code management system. Build it, but then clear 219 # the builder so that it doesn't get built *again* 220 # during the actual build phase. 221 f.build() 222 f.built() 223 f.builder_set(None) 224 if f.exists(): 225 _file_ = open(f.get_abspath(), "rb") 226 if _file_: 227 # Chdir to the SConscript directory. Use a path 228 # name relative to the SConstruct file so that if 229 # we're using the -f option, we're essentially 230 # creating a parallel SConscript directory structure 231 # in our local directory tree. 232 # 233 # XXX This is broken for multiple-repository cases 234 # where the SConstruct and SConscript files might be 235 # in different Repositories. For now, cross that 236 # bridge when someone comes to it. 237 try: 238 src_dir = kw['src_dir'] 239 except KeyError: 240 ldir = fs.Dir(f.dir.get_path(sd)) 241 else: 242 ldir = fs.Dir(src_dir) 243 if not ldir.is_under(f.dir): 244 # They specified a source directory, but 245 # it's above the SConscript directory. 246 # Do the sensible thing and just use the 247 # SConcript directory. 248 ldir = fs.Dir(f.dir.get_path(sd)) 249 try: 250 fs.chdir(ldir, change_os_dir=sconscript_chdir) 251 except OSError: 252 # There was no local directory, so we should be 253 # able to chdir to the Repository directory. 254 # Note that we do this directly, not through 255 # fs.chdir(), because we still need to 256 # interpret the stuff within the SConscript file 257 # relative to where we are logically. 258 fs.chdir(ldir, change_os_dir=0) 259 os.chdir(actual.dir.get_abspath()) 260 261 # Append the SConscript directory to the beginning 262 # of sys.path so Python modules in the SConscript 263 # directory can be easily imported. 264 sys.path = [ f.dir.get_abspath() ] + sys.path 265 266 # This is the magic line that actually reads up 267 # and executes the stuff in the SConscript file. 268 # The locals for this frame contain the special 269 # bottom-of-the-stack marker so that any 270 # exceptions that occur when processing this 271 # SConscript can base the printed frames at this 272 # level and not show SCons internals as well. 273 call_stack[-1].globals.update({stack_bottom:1}) 274 old_file = call_stack[-1].globals.get('__file__') 275 try: 276 del call_stack[-1].globals['__file__'] 277 except KeyError: 278 pass 279 try: 280 try: 281 # _file_ = SCons.Util.to_str(_file_) 282 if Main.print_time: 283 time1 = time.time() 284 exec(compile(_file_.read(), _file_.name, 'exec'), 285 call_stack[-1].globals) 286 except SConscriptReturn: 287 pass 288 finally: 289 if Main.print_time: 290 time2 = time.time() 291 print('SConscript:%s took %0.3f ms' % (f.get_abspath(), (time2 - time1) * 1000.0)) 292 293 if old_file is not None: 294 call_stack[-1].globals.update({__file__:old_file}) 295 else: 296 handle_missing_SConscript(f, kw.get('must_exist', None)) 297 298 finally: 299 SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1 300 sys.path = old_sys_path 301 frame = call_stack.pop() 302 try: 303 fs.chdir(frame.prev_dir, change_os_dir=sconscript_chdir) 304 except OSError: 305 # There was no local directory, so chdir to the 306 # Repository directory. Like above, we do this 307 # directly. 308 fs.chdir(frame.prev_dir, change_os_dir=0) 309 rdir = frame.prev_dir.rdir() 310 rdir._create() # Make sure there's a directory there. 311 try: 312 os.chdir(rdir.get_abspath()) 313 except OSError as e: 314 # We still couldn't chdir there, so raise the error, 315 # but only if actions are being executed. 316 # 317 # If the -n option was used, the directory would *not* 318 # have been created and we should just carry on and 319 # let things muddle through. This isn't guaranteed 320 # to work if the SConscript files are reading things 321 # from disk (for example), but it should work well 322 # enough for most configurations. 323 if SCons.Action.execute_actions: 324 raise e 325 326 results.append(frame.retval) 327 328 # if we only have one script, don't return a tuple 329 if len(results) == 1: 330 return results[0] 331 else: 332 return tuple(results)
333
334 -def SConscript_exception(file=sys.stderr):
335 """Print an exception stack trace just for the SConscript file(s). 336 This will show users who have Python errors where the problem is, 337 without cluttering the output with all of the internal calls leading 338 up to where we exec the SConscript.""" 339 exc_type, exc_value, exc_tb = sys.exc_info() 340 tb = exc_tb 341 while tb and stack_bottom not in tb.tb_frame.f_locals: 342 tb = tb.tb_next 343 if not tb: 344 # We did not find our exec statement, so this was actually a bug 345 # in SCons itself. Show the whole stack. 346 tb = exc_tb 347 stack = traceback.extract_tb(tb) 348 try: 349 type = exc_type.__name__ 350 except AttributeError: 351 type = str(exc_type) 352 if type[:11] == "exceptions.": 353 type = type[11:] 354 file.write('%s: %s:\n' % (type, exc_value)) 355 for fname, line, func, text in stack: 356 file.write(' File "%s", line %d:\n' % (fname, line)) 357 file.write(' %s\n' % text)
358
359 -def annotate(node):
360 """Annotate a node with the stack frame describing the 361 SConscript file and line number that created it.""" 362 tb = sys.exc_info()[2] 363 while tb and stack_bottom not in tb.tb_frame.f_locals: 364 tb = tb.tb_next 365 if not tb: 366 # We did not find any exec of an SConscript file: what?! 367 raise SCons.Errors.InternalError("could not find SConscript stack frame") 368 node.creator = traceback.extract_stack(tb)[0]
369 370 # The following line would cause each Node to be annotated using the 371 # above function. Unfortunately, this is a *huge* performance hit, so 372 # leave this disabled until we find a more efficient mechanism. 373 #SCons.Node.Annotate = annotate 374
375 -class SConsEnvironment(SCons.Environment.Base):
376 """An Environment subclass that contains all of the methods that 377 are particular to the wrapper SCons interface and which aren't 378 (or shouldn't be) part of the build engine itself. 379 380 Note that not all of the methods of this class have corresponding 381 global functions, there are some private methods. 382 """ 383 384 # 385 # Private methods of an SConsEnvironment. 386 #
387 - def _exceeds_version(self, major, minor, v_major, v_minor):
388 """Return 1 if 'major' and 'minor' are greater than the version 389 in 'v_major' and 'v_minor', and 0 otherwise.""" 390 return (major > v_major or (major == v_major and minor > v_minor))
391
392 - def _get_major_minor_revision(self, version_string):
393 """Split a version string into major, minor and (optionally) 394 revision parts. 395 396 This is complicated by the fact that a version string can be 397 something like 3.2b1.""" 398 version = version_string.split(' ')[0].split('.') 399 v_major = int(version[0]) 400 v_minor = int(re.match('\d+', version[1]).group()) 401 if len(version) >= 3: 402 v_revision = int(re.match('\d+', version[2]).group()) 403 else: 404 v_revision = 0 405 return v_major, v_minor, v_revision
406
407 - def _get_SConscript_filenames(self, ls, kw):
408 """ 409 Convert the parameters passed to SConscript() calls into a list 410 of files and export variables. If the parameters are invalid, 411 throws SCons.Errors.UserError. Returns a tuple (l, e) where l 412 is a list of SConscript filenames and e is a list of exports. 413 """ 414 exports = [] 415 416 if len(ls) == 0: 417 try: 418 dirs = kw["dirs"] 419 except KeyError: 420 raise SCons.Errors.UserError("Invalid SConscript usage - no parameters") 421 422 if not SCons.Util.is_List(dirs): 423 dirs = [ dirs ] 424 dirs = list(map(str, dirs)) 425 426 name = kw.get('name', 'SConscript') 427 428 files = [os.path.join(n, name) for n in dirs] 429 430 elif len(ls) == 1: 431 432 files = ls[0] 433 434 elif len(ls) == 2: 435 436 files = ls[0] 437 exports = self.Split(ls[1]) 438 439 else: 440 441 raise SCons.Errors.UserError("Invalid SConscript() usage - too many arguments") 442 443 if not SCons.Util.is_List(files): 444 files = [ files ] 445 446 if kw.get('exports'): 447 exports.extend(self.Split(kw['exports'])) 448 449 variant_dir = kw.get('variant_dir') or kw.get('build_dir') 450 if variant_dir: 451 if len(files) != 1: 452 raise SCons.Errors.UserError("Invalid SConscript() usage - can only specify one SConscript with a variant_dir") 453 duplicate = kw.get('duplicate', 1) 454 src_dir = kw.get('src_dir') 455 if not src_dir: 456 src_dir, fname = os.path.split(str(files[0])) 457 files = [os.path.join(str(variant_dir), fname)] 458 else: 459 if not isinstance(src_dir, SCons.Node.Node): 460 src_dir = self.fs.Dir(src_dir) 461 fn = files[0] 462 if not isinstance(fn, SCons.Node.Node): 463 fn = self.fs.File(fn) 464 if fn.is_under(src_dir): 465 # Get path relative to the source directory. 466 fname = fn.get_path(src_dir) 467 files = [os.path.join(str(variant_dir), fname)] 468 else: 469 files = [fn.get_abspath()] 470 kw['src_dir'] = variant_dir 471 self.fs.VariantDir(variant_dir, src_dir, duplicate) 472 473 return (files, exports)
474 475 # 476 # Public methods of an SConsEnvironment. These get 477 # entry points in the global namespace so they can be called 478 # as global functions. 479 # 480
481 - def Configure(self, *args, **kw):
482 if not SCons.Script.sconscript_reading: 483 raise SCons.Errors.UserError("Calling Configure from Builders is not supported.") 484 kw['_depth'] = kw.get('_depth', 0) + 1 485 return SCons.Environment.Base.Configure(self, *args, **kw)
486
487 - def Default(self, *targets):
488 SCons.Script._Set_Default_Targets(self, targets)
489
490 - def EnsureSConsVersion(self, major, minor, revision=0):
491 """Exit abnormally if the SCons version is not late enough.""" 492 # split string to avoid replacement during build process 493 if SCons.__version__ == '__' + 'VERSION__': 494 SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning, 495 "EnsureSConsVersion is ignored for development version") 496 return 497 scons_ver = self._get_major_minor_revision(SCons.__version__) 498 if scons_ver < (major, minor, revision): 499 if revision: 500 scons_ver_string = '%d.%d.%d' % (major, minor, revision) 501 else: 502 scons_ver_string = '%d.%d' % (major, minor) 503 print("SCons %s or greater required, but you have SCons %s" % \ 504 (scons_ver_string, SCons.__version__)) 505 sys.exit(2)
506
507 - def EnsurePythonVersion(self, major, minor):
508 """Exit abnormally if the Python version is not late enough.""" 509 if sys.version_info < (major, minor): 510 v = sys.version.split()[0] 511 print("Python %d.%d or greater required, but you have Python %s" %(major,minor,v)) 512 sys.exit(2)
513
514 - def Exit(self, value=0):
515 sys.exit(value)
516
517 - def Export(self, *vars, **kw):
518 for var in vars: 519 global_exports.update(compute_exports(self.Split(var))) 520 global_exports.update(kw)
521
522 - def GetLaunchDir(self):
523 global launch_dir 524 return launch_dir
525
526 - def GetOption(self, name):
527 name = self.subst(name) 528 return SCons.Script.Main.GetOption(name)
529
530 - def Help(self, text, append=False):
531 text = self.subst(text, raw=1) 532 SCons.Script.HelpFunction(text, append=append)
533
534 - def Import(self, *vars):
535 try: 536 frame = call_stack[-1] 537 globals = frame.globals 538 exports = frame.exports 539 for var in vars: 540 var = self.Split(var) 541 for v in var: 542 if v == '*': 543 globals.update(global_exports) 544 globals.update(exports) 545 else: 546 if v in exports: 547 globals[v] = exports[v] 548 else: 549 globals[v] = global_exports[v] 550 except KeyError as x: 551 raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x)
552
553 - def SConscript(self, *ls, **kw):
554 """Execute SCons configuration files. 555 556 Parameters: 557 *ls (str or list): configuration file(s) to execute. 558 559 Keyword arguments: 560 dirs (list): execute SConscript in each listed directory. 561 name (str): execute script 'name' (used only with 'dirs'). 562 exports (list or dict): locally export variables the 563 called script(s) can import. 564 variant_dir (str): mirror sources needed for the build in 565 a variant directory to allow building in it. 566 duplicate (bool): physically duplicate sources instead of just 567 adjusting paths of derived files (used only with 'variant_dir') 568 (default is True). 569 must_exist (bool): fail if a requested script is missing 570 (default is False, default is deprecated). 571 572 Returns: 573 list of variables returned by the called script 574 575 Raises: 576 UserError: a script is not found and such exceptions are enabled. 577 """ 578 579 if 'build_dir' in kw: 580 msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead.""" 581 SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg) 582 def subst_element(x, subst=self.subst): 583 if SCons.Util.is_List(x): 584 x = list(map(subst, x)) 585 else: 586 x = subst(x) 587 return x
588 ls = list(map(subst_element, ls)) 589 subst_kw = {} 590 for key, val in kw.items(): 591 if SCons.Util.is_String(val): 592 val = self.subst(val) 593 elif SCons.Util.is_List(val): 594 result = [] 595 for v in val: 596 if SCons.Util.is_String(v): 597 v = self.subst(v) 598 result.append(v) 599 val = result 600 subst_kw[key] = val 601 602 files, exports = self._get_SConscript_filenames(ls, subst_kw) 603 subst_kw['exports'] = exports 604 return _SConscript(self.fs, *files, **subst_kw)
605
606 - def SConscriptChdir(self, flag):
607 global sconscript_chdir 608 sconscript_chdir = flag
609
610 - def SetOption(self, name, value):
611 name = self.subst(name) 612 SCons.Script.Main.SetOption(name, value)
613 614 # 615 # 616 # 617 SCons.Environment.Environment = SConsEnvironment 618
619 -def Configure(*args, **kw):
620 if not SCons.Script.sconscript_reading: 621 raise SCons.Errors.UserError("Calling Configure from Builders is not supported.") 622 kw['_depth'] = 1 623 return SCons.SConf.SConf(*args, **kw)
624 625 # It's very important that the DefaultEnvironmentCall() class stay in this 626 # file, with the get_calling_namespaces() function, the compute_exports() 627 # function, the Frame class and the SConsEnvironment.Export() method. 628 # These things make up the calling stack leading up to the actual global 629 # Export() or SConscript() call that the user issued. We want to allow 630 # users to export local variables that they define, like so: 631 # 632 # def func(): 633 # x = 1 634 # Export('x') 635 # 636 # To support this, the get_calling_namespaces() function assumes that 637 # the *first* stack frame that's not from this file is the local frame 638 # for the Export() or SConscript() call. 639 640 _DefaultEnvironmentProxy = None 641
642 -def get_DefaultEnvironmentProxy():
643 global _DefaultEnvironmentProxy 644 if not _DefaultEnvironmentProxy: 645 default_env = SCons.Defaults.DefaultEnvironment() 646 _DefaultEnvironmentProxy = SCons.Environment.NoSubstitutionProxy(default_env) 647 return _DefaultEnvironmentProxy
648
649 -class DefaultEnvironmentCall(object):
650 """A class that implements "global function" calls of 651 Environment methods by fetching the specified method from the 652 DefaultEnvironment's class. Note that this uses an intermediate 653 proxy class instead of calling the DefaultEnvironment method 654 directly so that the proxy can override the subst() method and 655 thereby prevent expansion of construction variables (since from 656 the user's point of view this was called as a global function, 657 with no associated construction environment)."""
658 - def __init__(self, method_name, subst=0):
659 self.method_name = method_name 660 if subst: 661 self.factory = SCons.Defaults.DefaultEnvironment 662 else: 663 self.factory = get_DefaultEnvironmentProxy
664 - def __call__(self, *args, **kw):
665 env = self.factory() 666 method = getattr(env, self.method_name) 667 return method(*args, **kw)
668 669
670 -def BuildDefaultGlobals():
671 """ 672 Create a dictionary containing all the default globals for 673 SConstruct and SConscript files. 674 """ 675 676 global GlobalDict 677 if GlobalDict is None: 678 GlobalDict = {} 679 680 import SCons.Script 681 d = SCons.Script.__dict__ 682 def not_a_module(m, d=d, mtype=type(SCons.Script)): 683 return not isinstance(d[m], mtype)
684 for m in filter(not_a_module, dir(SCons.Script)): 685 GlobalDict[m] = d[m] 686 687 return GlobalDict.copy() 688 689 # Local Variables: 690 # tab-width:4 691 # indent-tabs-mode:nil 692 # End: 693 # vim: set expandtab tabstop=4 shiftwidth=4: 694