From: stevenknight Date: Sat, 13 Sep 2008 04:48:36 +0000 (+0000) Subject: Additional clean up of how we import some SCons.* module names, including X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ec1f3c71ca8d1a120c9a151dfcb6833811419001;p=scons.git Additional clean up of how we import some SCons.* module names, including making SCons.Job.stack_size a variable that always exists, instead of one that gets set from outside and requires SCons.Job to check for an AttributeError. git-svn-id: http://scons.tigris.org/svn/scons/trunk@3393 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Job.py b/src/engine/SCons/Job.py index e6d02e48..86886e04 100644 --- a/src/engine/SCons/Job.py +++ b/src/engine/SCons/Job.py @@ -34,7 +34,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import signal -import SCons +import SCons.Errors # The default stack size (in kilobytes) of the threads used to execute # jobs in parallel. @@ -44,6 +44,7 @@ import SCons # parallelized the build. For example, the default stack size on linux # is 8 MBytes. +explicit_stack_size = None default_stack_size = 256 interrupt_msg = 'Build interrupted.' @@ -81,9 +82,8 @@ class Jobs: self.job = None if num > 1: - try: - stack_size = SCons.Job.stack_size - except AttributeError: + stack_size = explicit_stack_size + if stack_size is None: stack_size = default_stack_size try: diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py index a024a9e0..46582c58 100644 --- a/src/engine/SCons/Script/Interactive.py +++ b/src/engine/SCons/Script/Interactive.py @@ -98,8 +98,6 @@ try: except ImportError: pass -import SCons - class SConsInteractiveCmd(cmd.Cmd): """\ build [TARGETS] Build the specified TARGETS and their dependencies. @@ -163,6 +161,7 @@ class SConsInteractiveCmd(cmd.Cmd): build [TARGETS] Build the specified TARGETS and their dependencies. 'b' is a synonym. """ + import SCons.Node import SCons.SConsign import SCons.Script.Main diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index dc24b226..12e7fbad 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -963,8 +963,8 @@ def _main(parser): SCons.Node.implicit_cache = options.implicit_cache SCons.Node.FS.set_duplicate(options.duplicate) fs.set_max_drift(options.max_drift) - if not options.stack_size is None: - SCons.Job.stack_size = options.stack_size + + SCons.Job.explicit_stack_size = options.stack_size platform = SCons.Platform.platform_module()