diff --git a/tools/reorder_message_file.py b/tools/reorder_message_file.py index 8434de8a24..a4f5e32bf1 100755 --- a/tools/reorder_message_file.py +++ b/tools/reorder_message_file.py @@ -165,6 +165,10 @@ def process_file(filename): with open(filename, encoding='utf-8') as f: lines = f.read().splitlines() + # Do not process the file if it is empty. + if len(lines) == 0: + return + # Search for the first line starting with the percent character. Everything # before it is considered the file header and is copied to the output with # leading and trailing spaces removed.