diff options
author | Mats Wichmann <mats@linux.com> | 2019-02-11 17:13:15 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-02-11 17:13:15 (GMT) |
commit | 325bf16d681320cc277fb65c873cae2e0a2cb46c (patch) | |
tree | ff35bf89f35e93dec56087b46a9ff7bb25d30758 /src/engine | |
parent | e452818853109597317e6525ff5cf2151e55e70b (diff) | |
download | SCons-325bf16d681320cc277fb65c873cae2e0a2cb46c.zip SCons-325bf16d681320cc277fb65c873cae2e0a2cb46c.tar.gz SCons-325bf16d681320cc277fb65c873cae2e0a2cb46c.tar.bz2 |
Fix is/is not syntax
In a few places, "is" and "is not" are used to compare with
a string or integer literal. Python 3.8 flags these with
a SyntaxWarning. Changed to == and !=
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/ActionTests.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Defaults.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index a27f598..3e83b50 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -490,7 +490,7 @@ class _ActionActionTestCase(unittest.TestCase): a = SCons.Action._ActionAction(cmdstr='cmdstr') assert not hasattr(a, 'strfunction') - assert a.cmdstr is 'cmdstr', a.cmdstr + assert a.cmdstr == 'cmdstr', a.cmdstr a = SCons.Action._ActionAction(cmdstr=None) assert not hasattr(a, 'strfunction') @@ -504,7 +504,7 @@ class _ActionActionTestCase(unittest.TestCase): assert a.presub is func1, a.presub a = SCons.Action._ActionAction(chdir=1) - assert a.chdir is 1, a.chdir + assert a.chdir == 1, a.chdir a = SCons.Action._ActionAction(exitstatfunc=func1) assert a.exitstatfunc is func1, a.exitstatfunc @@ -518,8 +518,8 @@ class _ActionActionTestCase(unittest.TestCase): strfunction=func1, varlist=t, ) - assert a.chdir is 'x', a.chdir - assert a.cmdstr is 'cmdstr', a.cmdstr + assert a.chdir == 'x', a.chdir + assert a.cmdstr == 'cmdstr', a.cmdstr assert a.exitstatfunc is func3, a.exitstatfunc assert a.presub is func2, a.presub assert a.strfunction is func1, a.strfunction diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 6b07750..9ca9ccd 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -210,7 +210,7 @@ def chmod_func(dest, mode): else: raise SyntaxError("Could not find +, - or =") operation_list = operation.split(operator) - if len(operation_list) is not 2: + if len(operation_list) != 2: raise SyntaxError("More than one operator found") user = operation_list[0].strip().replace("a", "ugo") permission = operation_list[1].strip() diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index a72c173..2525e0f 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -963,7 +963,7 @@ class BaseTestCase(unittest.TestCase,TestEnvironmentFixture): self.assertRaises(AttributeError, getattr, bw, 'foobar') bw.foobar = 42 - assert bw.foobar is 42 + assert bw.foobar == 42 # This unit test is currently disabled because we don't think the # underlying method it tests (Environment.BuilderWrapper.execute()) @@ -1777,15 +1777,15 @@ def exists(env): env2 = env1.Clone() env3 = env1.Clone(tools=[bar, baz]) - assert env1.get('FOO') is 1 + assert env1.get('FOO') == 1 assert env1.get('BAR') is None assert env1.get('BAZ') is None - assert env2.get('FOO') is 1 + assert env2.get('FOO') == 1 assert env2.get('BAR') is None assert env2.get('BAZ') is None - assert env3.get('FOO') is 1 - assert env3.get('BAR') is 2 - assert env3.get('BAZ') is 3 + assert env3.get('FOO') == 1 + assert env3.get('BAR') == 2 + assert env3.get('BAZ') == 3 # Ensure that recursive variable substitution when copying # environments works properly. |