diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 13 | ||||
-rw-r--r-- | src/engine/SCons/SConf.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/ScannerTests.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py | 12 | ||||
-rw-r--r-- | src/engine/SCons/Util.py | 28 | ||||
-rw-r--r-- | src/engine/SCons/UtilTests.py | 10 |
7 files changed, 37 insertions, 36 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index eddfdf0..9c19481 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -2508,8 +2508,8 @@ class FileTestCase(_tempdirTestCase): build_f1, src_f1) def test_changed(self): - """ - Verify that changes between BuildInfo's list of souces, depends, and implicit + """ + Verify that changes between BuildInfo's list of souces, depends, and implicit dependencies do not corrupt content signature values written to .SConsign when using CacheDir and Timestamp-MD5 decider. This is for issue #2980 @@ -3374,10 +3374,11 @@ class find_fileTestCase(unittest.TestCase): node_pseudo.set_src_builder(1) # Any non-zero value. paths = tuple(map(fs.Dir, ['.', 'same', './bar'])) - nodes = [SCons.Node.FS.find_file('foo', paths)] - nodes.append(SCons.Node.FS.find_file('baz', paths)) - nodes.append(SCons.Node.FS.find_file('pseudo', paths)) - nodes.append(SCons.Node.FS.find_file('same', paths)) + nodes = [SCons.Node.FS.find_file('foo', paths), + SCons.Node.FS.find_file('baz', paths), + SCons.Node.FS.find_file('pseudo', paths), + SCons.Node.FS.find_file('same', paths) + ] file_names = list(map(str, nodes)) file_names = list(map(os.path.normpath, file_names)) diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 71729c9..0195ac4 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -1067,7 +1067,7 @@ def CheckLibWithHeader(context, libs, header, language, """ prog_prefix, dummy = \ createIncludesFromHeaders(header, 0) - if libs == []: + if not libs: libs = [None] if not SCons.Util.is_List(libs): diff --git a/src/engine/SCons/Scanner/ScannerTests.py b/src/engine/SCons/Scanner/ScannerTests.py index 64a2345..abe4042 100644 --- a/src/engine/SCons/Scanner/ScannerTests.py +++ b/src/engine/SCons/Scanner/ScannerTests.py @@ -236,7 +236,7 @@ class BaseTestCase(unittest.TestCase): def test___cmp__(self): """Test the Scanner.Base class __cmp__() method""" s = SCons.Scanner.Base(self.func, "Cmp") - assert s != None + assert s is not None def test_hash(self): """Test the Scanner.Base class __hash__() method""" @@ -578,8 +578,6 @@ class ClassicTestCase(unittest.TestCase): "recursive = 1 didn't return all nodes: %s" % n) - - class ClassicCPPTestCase(unittest.TestCase): def test_find_include(self): """Test the Scanner.ClassicCPP find_include() method""" diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 86bdbe0..53b9d59 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -509,7 +509,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') return True - elif ver_num <= 14 and ver_num >= 8: + elif 14 >= ver_num >= 8: # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested # if not host_trgt_dir @@ -541,7 +541,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') return True - elif ver_num < 8 and ver_num >= 6: + elif 8 > ver_num >= 6: # not sure about these versions so if a walk the VC dir (could be slow) for root, _, files in os.walk(vc_dir): if _CL_EXE_NAME in files: diff --git a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py index e7b8cfa..5d2de3e 100644 --- a/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py +++ b/src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1/extensions/docbook.py @@ -33,7 +33,7 @@ def adjustColumnWidths(ctx, nodeset): # Get the nominal table width varString = lookupVariable(tctxt, "nominal.table.width", None) - if varString == None: + if varString is None: nominalWidth = 6 * pixelsPerInch; else: nominalWidth = convertLength(varString); @@ -58,13 +58,13 @@ def adjustColumnWidths(ctx, nodeset): colChildren = colgroup.children col = colChildren - while col != None: + while col is not None: if foStylesheet: width = col.prop("column-width") else: width = col.prop("width") - if width == None: + if width is None: width = "1*" relPart = 0.0 @@ -145,7 +145,7 @@ def adjustColumnWidths(ctx, nodeset): # Side-effect free? We don' need no steenkin' side-effect free! count = 0 col = colChildren - while col != None: + while col is not None: if foStylesheet: col.setProp("column-width", widths[count]) else: @@ -162,7 +162,7 @@ def convertLength(length): global unitHash m = re.search('([+-]?[\d\.]+)(\S+)', length) - if m != None and m.lastindex > 1: + if m is not None and m.lastindex > 1: unit = pixelsPerInch if m.group(2) in unitHash: unit = unitHash[m.group(2)] @@ -204,7 +204,7 @@ def correctRoundingError(floatWidths): def lookupVariable(tctxt, varName, default): varString = tctxt.variableLookup(varName, None) - if varString == None: + if varString is None: return default # If it's a list, get the first element diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 8519a98..28674d1 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -312,18 +312,21 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None): '\n') sys.stdout.write(legend) - tags = ['['] - tags.append(' E'[IDX(root.exists())]) - tags.append(' R'[IDX(root.rexists() and not root.exists())]) - tags.append(' BbB'[[0,1][IDX(root.has_explicit_builder())] + - [0,2][IDX(root.has_builder())]]) - tags.append(' S'[IDX(root.side_effect)]) - tags.append(' P'[IDX(root.precious)]) - tags.append(' A'[IDX(root.always_build)]) - tags.append(' C'[IDX(root.is_up_to_date())]) - tags.append(' N'[IDX(root.noclean)]) - tags.append(' H'[IDX(root.nocache)]) - tags.append(']') + tags = [ + '[', + ' E'[IDX(root.exists())], + ' R'[IDX(root.rexists() and not root.exists())], + ' BbB'[ + [0, 1][IDX(root.has_explicit_builder())] + + [0, 2][IDX(root.has_builder())] + ], + ' S'[IDX(root.side_effect)], ' P'[IDX(root.precious)], + ' A'[IDX(root.always_build)], + ' C'[IDX(root.is_up_to_date())], + ' N'[IDX(root.noclean)], + ' H'[IDX(root.nocache)], + ']' + ] else: tags = [] @@ -352,7 +355,6 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None): margin.pop() - # Functions for deciding if things are like various types, mainly to # handle UserDict, UserList and UserString like their underlying types. # diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index 0017844..7f6508d 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -451,11 +451,11 @@ class UtilTestCase(unittest.TestCase): assert get_environment_var("${BAR}") == "BAR", get_environment_var("${BAR}") assert get_environment_var("$FOO_BAR1234") == "FOO_BAR1234", get_environment_var("$FOO_BAR1234") assert get_environment_var("${BAR_FOO1234}") == "BAR_FOO1234", get_environment_var("${BAR_FOO1234}") - assert get_environment_var("${BAR}FOO") == None, get_environment_var("${BAR}FOO") - assert get_environment_var("$BAR ") == None, get_environment_var("$BAR ") - assert get_environment_var("FOO$BAR") == None, get_environment_var("FOO$BAR") - assert get_environment_var("$FOO[0]") == None, get_environment_var("$FOO[0]") - assert get_environment_var("${some('complex expression')}") == None, get_environment_var( + assert get_environment_var("${BAR}FOO") is None, get_environment_var("${BAR}FOO") + assert get_environment_var("$BAR ") is None, get_environment_var("$BAR ") + assert get_environment_var("FOO$BAR") is None, get_environment_var("FOO$BAR") + assert get_environment_var("$FOO[0]") is None, get_environment_var("$FOO[0]") + assert get_environment_var("${some('complex expression')}") is None, get_environment_var( "${some('complex expression')}") def test_Proxy(self): |