From df9762f7954d479b1cd377ae4e489ae53bc116fc Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 30 Apr 2026 10:56:49 +0200 Subject: [PATCH] minikconf: pull main program into a function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid pulluting the global namespace. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- scripts/minikconf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/minikconf.py b/scripts/minikconf.py index 7f0b64b1e0..d728fd867f 100644 --- a/scripts/minikconf.py +++ b/scripts/minikconf.py @@ -666,7 +666,7 @@ def scan_token(self, ch): return None -if __name__ == '__main__': +def main() -> None: argv = sys.argv mode = defconfig if len(sys.argv) > 1: @@ -712,3 +712,6 @@ def scan_token(self, ch): for fname in data.previously_included: print ('%s: %s' % (argv[1], fname), file=deps) deps.close() + +if __name__ == '__main__': + main()