diff options
author | Mats Wichmann <mats@linux.com> | 2018-08-26 15:10:58 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2018-10-03 18:44:45 (GMT) |
commit | 6bb0f67833cd198253dcf94342da7e792aaf9a55 (patch) | |
tree | 4b88fa5c963dee6cf9ba33eabaa3f53e937f8086 /src/script | |
parent | ab7b1758d760159db1665059f464517d039ac6a4 (diff) | |
download | SCons-6bb0f67833cd198253dcf94342da7e792aaf9a55.zip SCons-6bb0f67833cd198253dcf94342da7e792aaf9a55.tar.gz SCons-6bb0f67833cd198253dcf94342da7e792aaf9a55.tar.bz2 |
A few syntax cleanups
Suggested by PyCharm. Includes three "real" changes:
1. src/engine/SCons/Node/__init__.py has a print statement in a function
which references 'self', but there is no 'self' defined (it is not
a method in a class). Guessing it should have been 'node'.
2. src/engine/SCons/Environment.py makes a call using 'kwbd' which is not
defined, looks like a copy-paste error and should be 'bd'.
3. src/engine/SCons/Tool/JavaCommon.py splits 'file', which is not
defined, was evidently supposed to be 'fn'.
These should be double-checked.
The rest are purely syntax: whitespace, dropping trailing semicolons,
using "is" to test for None, simplifying comparisons, normalizing
docstring commenting ("always triple double quotes"), unneeded
backslashes.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/scons-time.py | 6 | ||||
-rw-r--r-- | src/script/sconsign.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/script/scons-time.py b/src/script/scons-time.py index aa875f1..d114f9a 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -58,12 +58,12 @@ def make_temp_file(**kw): return result def HACK_for_exec(cmd, *args): - ''' + """ For some reason, Python won't allow an exec() within a function that also declares an internal function (including lambda functions). This function is a hack that calls exec() in a function with no internal functions. - ''' + """ if not args: exec(cmd) elif len(args) == 1: exec(cmd, args[0]) else: exec(cmd, args[0], args[1]) @@ -147,7 +147,7 @@ class Gnuplotter(Plotter): return line.plot_string() def vertical_bar(self, x, type, label, comment): - if self.get_min_x() <= x and x <= self.get_max_x(): + if self.get_min_x() <= x <= self.get_max_x(): points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))] self.line(points, type, label, comment) diff --git a/src/script/sconsign.py b/src/script/sconsign.py index e7bc271..559dffe 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -275,7 +275,7 @@ def map_bkids(entry, name): result = [] for i in range(len(bkids)): result.append(nodeinfo_string(bkids[i], bkidsigs[i], " ")) - if result == []: + if not result: return None return "\n ".join(result) |