@@ -40,7 +40,7 @@ def _find_duplicated_modules(suite, directory):
def _built_modules_dict(modules, logger):
modules_dict = {}
- if modules == None:
+ if modules is None:
return modules_dict
for module in modules:
@@ -293,7 +293,7 @@ def SSHCall(command, logger, timeout=None, raw=False, **opts):
logger.debug('No output from SSH call')
# timout or not, make sure process exits and is not hanging
- if process.returncode == None:
+ if process.returncode is None:
try:
process.wait(timeout=5)
except TimeoutExpired:
@@ -339,7 +339,7 @@ def SSHCall(command, logger, timeout=None, raw=False, **opts):
# whilst running and ensure we don't leave a process behind.
if process.poll() is None:
process.kill()
- if process.returncode == None:
+ if process.returncode is None:
process.wait()
logger.debug('Something went wrong, killing SSH process')
raise
@@ -583,7 +583,7 @@ class ExportTestContext(RuntimeTestContext):
super().__init__(d, target, exported)
tag = parsedArgs.get("tag", None)
- self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS")
+ self.tagexp = tag if tag is not None else d.getVar("TEST_SUITES_TAGS")
self.sigterm = None
@@ -67,7 +67,7 @@ class TestRealPath(TestCase):
def test_norm(self):
for l in self.LINKS:
- if l[2] == None:
+ if l[2] is None:
continue
target_p = self.__realpath(l[0], True)
@@ -13,7 +13,7 @@ class OETestCalledProcessError(subprocess.CalledProcessError):
s = super().__str__()
s = s + "\nStandard Output: " + strify(self.output)
# stderr is not available for check_output method
- if self.stderr != None:
+ if self.stderr is not None:
s = s + "\nStandard Error: " + strify(self.stderr)
return s
Comparing to None with == or != is unidiomatic and can be overridden by __eq__; use identity checks instead. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- meta/lib/oeqa/core/loader.py | 2 +- meta/lib/oeqa/core/target/ssh.py | 4 ++-- meta/lib/oeqa/oetest.py | 2 +- meta/lib/oeqa/selftest/cases/oelib/path.py | 2 +- meta/lib/oeqa/utils/subprocesstweak.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)