flake8 reported:
tests/ftests/process.py:276:12: E721 do not compare types, for exact
checks use is / is not, for instance checks use isinstance()
tests/ftests/process.py:278:14: E721 do not compare types, for exact
checks use is / is not, for instance checks use isinstance()
Process.kill() only needs to normalise string or integer inputs into a
list before signalling, so switch the raw type() comparisons to
isinstance() calls. Behaviour stays the same and the lint warning
disappears.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
if not pids:
return
- if type(pids) == str:
+ if isinstance(pids, str):
pids = [int(pid) for pid in pids.splitlines()]
- elif type(pids) == int:
+ elif isinstance(pids, int):
pids = [pids]
for pid in pids: