Skip to content

Commit 66939a6

Browse files
author
Marcin Godzina
committed
[#3600] check if message file is empty
1 parent 154174e commit 66939a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/reorder_message_file.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ def process_file(filename):
165165
with open(filename, encoding='utf-8') as f:
166166
lines = f.read().splitlines()
167167

168+
# Do not process the file if it is empty.
169+
if len(lines) == 0:
170+
return
171+
168172
# Search for the first line starting with the percent character. Everything
169173
# before it is considered the file header and is copied to the output with
170174
# leading and trailing spaces removed.

0 commit comments

Comments
 (0)