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

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