Merge "Only run warn.py's main function if it is the main program."

This commit is contained in:
Treehugger Robot 2016-09-29 03:58:07 +00:00 committed by Gerrit Code Review
commit 312c310f7c
1 changed files with 10 additions and 6 deletions

View File

@ -2342,10 +2342,14 @@ def dump_csv():
print '{},,{}'.format(total, 'All warnings')
##### Main function starts here. #########################
def main():
parse_input_file()
if args.gencsv:
dump_csv()
else:
dump_html()
parse_input_file()
if args.gencsv:
dump_csv()
else:
dump_html()
# Run main function if warn.py is the main program.
if __name__ == '__main__':
main()