diff options
author | Mats Wichmann <mats@linux.com> | 2019-04-21 16:40:07 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-04-21 18:24:15 (GMT) |
commit | 54975192faaf0042636ff5b1fc3617dc834294f4 (patch) | |
tree | ab16c2e97d88594e21cff644ccf53eef6244251f /src/engine/SCons/Executor.py | |
parent | a892ff25ef22819b9aa50a5bc64268c5722250b4 (diff) | |
download | SCons-54975192faaf0042636ff5b1fc3617dc834294f4.zip SCons-54975192faaf0042636ff5b1fc3617dc834294f4.tar.gz SCons-54975192faaf0042636ff5b1fc3617dc834294f4.tar.bz2 |
Fixup some code triggering pylint errors.
Assorted fixups: exception types, redefined functions, globals, etc.
Some old code removed to resolve issues (hashlib is always present on
modern Pythons; no longer need the code for 2.5-and-earlier optparse).
cmp is not a builtin function in Py3, drop one (unused) use; replace one.
Fix another instance of renaming to SConsEnvironmentError.
TODO flagged some instances of doing a raise without argument but not
inside a try block - this is not considered legal, since raise
with no argument is for re-raising an exception, but I don't know
exactly how to resolve this in these cases. Also flagged an instance
of raising an int instead of an exception class. We can either leave
these as markers or update the PR.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/engine/SCons/Executor.py')
-rw-r--r-- | src/engine/SCons/Executor.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/engine/SCons/Executor.py b/src/engine/SCons/Executor.py index 01d01cd..6c68e09 100644 --- a/src/engine/SCons/Executor.py +++ b/src/engine/SCons/Executor.py @@ -41,10 +41,10 @@ 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 @@ -127,13 +127,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 @@ -597,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', @@ -613,7 +613,7 @@ 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') self.batches = [Batch(kw['targets'][:], [])] @@ -649,7 +649,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 |