]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/077: Remove unnecessary use of global in teardown()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Thu, 8 Jan 2026 06:35:45 +0000 (12:05 +0530)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 10 Mar 2026 16:38:04 +0000 (22:08 +0530)
The global statement is only needed when assigning to a global variable,
not when only reading its value. In teardown(), the global
initial_pid_list declaration is unnecessary since pid is only being
read. Remove the global initial_pid_list from teardown().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/ftests/077-pybindings-cgroup_get_procs.py

index f155789796383a560df29780c9912e76228ac790..09a9ab75c4e1389fa4d75490ec4f7de1ca72d538 100755 (executable)
@@ -83,8 +83,6 @@ def test(config):
 
 
 def teardown(config):
-    global initial_pid_list
-
     Process.kill(config, initial_pid_list)
     CgroupCli.delete(config, CONTROLLERS, EMPTY_CGNAME)
     CgroupCli.delete(config, CONTROLLERS, os.path.dirname(CGNAME), recursive=True)