From d85af7219a35c8e2350bdfba592643fdf7b5be07 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Tue, 7 Jul 2026 19:49:56 +0000 Subject: [PATCH] test/zdtm: remove redundant variable initializations Remove C-style pre-initializations of variables that are always set before use. Python does not require variables to be declared before assignment, so sentinel values like `pid = -1`, `status = -1`, and `stats_written = -1` are unnecessary when the variable is unconditionally assigned in the following code. Also drop the unused capture of __dump_process.wait() return value in fini(). Assisted-by: Claude Code (claude-opus-4-6) Signed-off-by: Adrian Reber --- test/zdtm.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/zdtm.py b/test/zdtm.py index 54a973adf..ed110104c 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -1178,7 +1178,7 @@ class criu: def fini(self): if self.__lazy_migrate: - ret = self.__dump_process.wait() + self.__dump_process.wait() if self.__lazy_pages_p: ret = self.__lazy_pages_p.wait() grep_errors(os.path.join(self.__ddir(), "lazy-pages.log"), err=ret) @@ -1360,7 +1360,6 @@ class criu: if not os.access(self.__stats_file("dump"), os.R_OK): return - stats_written = -1 with open(self.__stats_file("dump"), 'rb') as stfile: stats = crpc.images.load(stfile) stent = stats['entries'][0]['dump'] @@ -2223,8 +2222,6 @@ class Launcher: self.wait() def __wait_one(self, flags): - pid = -1 - status = -1 signal.alarm(10) while True: try: