summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Job.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:54:23 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2019-07-23 16:54:23 +0200
commitc2d9eaeffe9d77d8d5087fb21a3256fde32047d4 (patch)
tree144aeb4702d258b0cfaf99cffb9f21e94b026459 /src/engine/SCons/Job.py
parent6ca68f29862bc7cbe5428426eee600cb1f3c05c1 (diff)
parentefdf3fdbcd2f7654cb8d1209a8b040914437bacd (diff)
Update upstream source from tag 'upstream/3.1.0'
Update to upstream version '3.1.0' with Debian dir e69b7671114411c368722827d87d86b44ed7cd40
Diffstat (limited to 'src/engine/SCons/Job.py')
-rw-r--r--src/engine/SCons/Job.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/engine/SCons/Job.py b/src/engine/SCons/Job.py
index 45bca62..12ba19f 100644
--- a/src/engine/SCons/Job.py
+++ b/src/engine/SCons/Job.py
@@ -29,7 +29,7 @@ stop, and wait on jobs.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Job.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog"
+__revision__ = "src/engine/SCons/Job.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan"
import SCons.compat
@@ -53,14 +53,14 @@ interrupt_msg = 'Build interrupted.'
class InterruptState(object):
- def __init__(self):
- self.interrupted = False
+ def __init__(self):
+ self.interrupted = False
- def set(self):
- self.interrupted = True
+ def set(self):
+ self.interrupted = True
- def __call__(self):
- return self.interrupted
+ def __call__(self):
+ return self.interrupted
class Jobs(object):
@@ -87,7 +87,7 @@ class Jobs(object):
stack_size = explicit_stack_size
if stack_size is None:
stack_size = default_stack_size
-
+
try:
self.job = Parallel(taskmaster, num, stack_size)
self.num_jobs = num
@@ -172,14 +172,14 @@ class Serial(object):
"""
def __init__(self, taskmaster):
- """Create a new serial job given a taskmaster.
+ """Create a new serial job given a taskmaster.
The taskmaster's next_task() method should return the next task
that needs to be executed, or None if there are no more tasks. The
taskmaster's executed() method will be called for each task when it
is successfully executed, or failed() will be called if it failed to
execute (e.g. execute() raised an exception)."""
-
+
self.taskmaster = taskmaster
self.interrupted = InterruptState()
@@ -188,7 +188,7 @@ class Serial(object):
and executing them, and return when there are no more tasks. If a task
fails to execute (i.e. execute() raises an exception), then the job will
stop."""
-
+
while True:
task = self.taskmaster.next_task()
@@ -199,7 +199,7 @@ class Serial(object):
task.prepare()
if task.needs_execute():
task.execute()
- except Exception as e:
+ except Exception:
if self.interrupted():
try:
raise SCons.Errors.BuildError(
@@ -269,7 +269,7 @@ else:
def __init__(self, num, stack_size, interrupted):
"""Create the request and reply queues, and 'num' worker threads.
-
+
One must specify the stack size of the worker threads. The
stack size is specified in kilobytes.
"""
@@ -277,11 +277,11 @@ else:
self.resultsQueue = queue.Queue(0)
try:
- prev_size = threading.stack_size(stack_size*1024)
+ prev_size = threading.stack_size(stack_size*1024)
except AttributeError as e:
# Only print a warning if the stack size has been
# explicitly set.
- if not explicit_stack_size is None:
+ if explicit_stack_size is not None:
msg = "Setting stack size is unsupported by this version of Python:\n " + \
e.args[0]
SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)
@@ -322,7 +322,7 @@ else:
self.requestQueue.put(None)
# Wait for all of the workers to terminate.
- #
+ #
# If we don't do this, later Python versions (2.4, 2.5) often
# seem to raise exceptions during shutdown. This happens
# in requestQueue.get(), as an assertion failure that
@@ -339,7 +339,7 @@ else:
self.workers = []
class Parallel(object):
- """This class is used to execute tasks in parallel, and is somewhat
+ """This class is used to execute tasks in parallel, and is somewhat
less efficient than Serial, but is appropriate for parallel builds.
This class is thread safe.
@@ -373,7 +373,7 @@ else:
an exception), then the job will stop."""
jobs = 0
-
+
while True:
# Start up as many available tasks as we're
# allowed to.