]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/process: satisfy E721 in Process.kill()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 3 Feb 2026 06:57:41 +0000 (12:27 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 19 Mar 2026 17:18:07 +0000 (11:18 -0600)
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>
tests/ftests/process.py

index 6833e7b4c746e5e384c7a29c8e022e7497a8ff47..454770b40fd60359e3edee68d589d02f4154f69f 100644 (file)
@@ -273,9 +273,9 @@ class Process(object):
         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: