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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user