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

Test: run warn.py --byproject build.log
Change-Id: I155cce8c952d6d8a02c8e1809bf61a46c847c26e
This commit is contained in:
Meike Baumgärtner
2016-09-28 10:48:06 -07:00
parent 6e12b72966
commit ac9d5df349

View File

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