summaryrefslogtreecommitdiff
path: root/engine/SCons/Executor.py
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Executor.py')
-rw-r--r--engine/SCons/Executor.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/engine/SCons/Executor.py b/engine/SCons/Executor.py
index 12a68d8..c3e22f5 100644
--- a/engine/SCons/Executor.py
+++ b/engine/SCons/Executor.py
@@ -6,7 +6,7 @@ Nodes.
"""
#
-# Copyright (c) 2001 - 2017 The SCons Foundation
+# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ Nodes.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from __future__ import print_function
-__revision__ = "src/engine/SCons/Executor.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
+__revision__ = "src/engine/SCons/Executor.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan"
import collections
@@ -36,15 +36,16 @@ import SCons.Debug
from SCons.Debug import logInstanceCreation
import SCons.Errors
import SCons.Memoize
+import SCons.Util
from SCons.compat import with_metaclass, NoSlotsPyPy
class Batch(object):
"""Remembers exact association between targets
and sources of executor."""
-
+
__slots__ = ('targets',
'sources')
-
+
def __init__(self, targets=[], sources=[]):
self.targets = targets
self.sources = sources
@@ -71,7 +72,7 @@ class TSList(collections.UserList):
return nl[i]
def __getslice__(self, i, j):
nl = self.func()
- i = max(i, 0); j = max(j, 0)
+ i, j = max(i, 0), max(j, 0)
return nl[i:j]
def __str__(self):
nl = self.func()
@@ -127,13 +128,13 @@ def execute_action_list(obj, target, kw):
status = act(*args, **kw)
if isinstance(status, SCons.Errors.BuildError):
status.executor = obj
- raise status
+ raise status # TODO pylint E0702: raising int not allowed
elif status:
msg = "Error %s" % status
raise SCons.Errors.BuildError(
- errstr=msg,
+ errstr=msg,
node=obj.batches[0].targets,
- executor=obj,
+ executor=obj,
action=act)
return status
@@ -450,6 +451,8 @@ class Executor(object, with_metaclass(NoSlotsPyPy)):
"""Fetch the signature contents. This is the main reason this
class exists, so we can compute this once and cache it regardless
of how many target or source Nodes there are.
+
+ Returns bytes
"""
try:
return self._memo['get_contents']
@@ -570,7 +573,6 @@ def AddBatchExecutor(key, executor):
nullenv = None
-import SCons.Util
class NullEnvironment(SCons.Util.Null):
import SCons.CacheDir
_CacheDir_path = None
@@ -595,7 +597,7 @@ class Null(object, with_metaclass(NoSlotsPyPy)):
disassociate Builders from Nodes entirely, so we're not
going to worry about unit tests for this--at least for now.
"""
-
+
__slots__ = ('pre_actions',
'post_actions',
'env',
@@ -611,9 +613,10 @@ class Null(object, with_metaclass(NoSlotsPyPy)):
'action_list',
'_do_execute',
'_execute_str')
-
+
def __init__(self, *args, **kw):
- if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null')
+ if SCons.Debug.track_instances:
+ logInstanceCreation(self, 'Executor.Null')
self.batches = [Batch(kw['targets'][:], [])]
def get_build_env(self):
return get_NullEnvironment()
@@ -647,7 +650,7 @@ class Null(object, with_metaclass(NoSlotsPyPy)):
"""Morph this Null executor to a real Executor object."""
batches = self.batches
self.__class__ = Executor
- self.__init__([])
+ self.__init__([])
self.batches = batches
# The following methods require morphing this Null Executor to a