Skip to content

Commit 6ed3b2a

Browse files
committed
Merge pull request BVLC#3292 from dgolden1/log-parse-no-test
parse_log.py bugfix: don't attempt to write CSV if there are no lines to write
2 parents c1126aa + 7f49d80 commit 6ed3b2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/extra/parse_log.py

+5
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ def write_csv(output_filename, dict_list, delimiter, verbose=False):
149149
"""Write a CSV file
150150
"""
151151

152+
if not dict_list:
153+
if verbose:
154+
print('Not writing %s; no lines to write' % output_filename)
155+
return
156+
152157
dialect = csv.excel
153158
dialect.delimiter = delimiter
154159

0 commit comments

Comments
 (0)