From a5d4e7ba0dd28bc34c7778bb889bf4f13bfe0fdf Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 6 May 2025 12:49:57 +0300 Subject: [PATCH] [check-static-inits.py] Cleanup --- src/check-static-inits.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/check-static-inits.py b/src/check-static-inits.py index 46ef031db..7cb22e910 100755 --- a/src/check-static-inits.py +++ b/src/check-static-inits.py @@ -25,7 +25,7 @@ if not OBJS: sys.exit(77) stat = 0 -tested = 0 +tested = False result = subprocess.run( objdump.split() + ["-t"] + OBJS, stdout=subprocess.PIPE, stderr=subprocess.PIPE @@ -34,18 +34,18 @@ result = subprocess.run( if result.returncode: if result.stderr.find(b"not recognized") != -1: # https://github.com/harfbuzz/harfbuzz/issues/3019 - print('objdump %s returned "not recognized", skipping') + print('objdump returned "not recognized", skipping') else: print("objdump returned error:\n%s" % (result.stderr.decode("utf-8"))) stat = 2 else: - tested = 1 + tested = True result = result.stdout.decode("utf-8") # Checking that no object file has static initializers -for l in re.findall(r"^.*\.[cd]tors.*$", result, re.MULTILINE): - if not re.match(r".*\b0+\b", l): +for lib in re.findall(r"^.*\.[cd]tors.*$", result, re.MULTILINE): + if not re.match(r".*\b0+\b", lib): print("Ouch, library has static initializers/finalizers") stat = 1