minikconf: pull main program into a function

Avoid pulluting the global namespace.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini
2026-04-30 10:56:49 +02:00
parent cd306d1f26
commit df9762f795

View File

@@ -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()