diff --git a/contrib/sort.py b/contrib/sort.py index 361f8a9b94..999f429908 100755 --- a/contrib/sort.py +++ b/contrib/sort.py @@ -76,7 +76,11 @@ def sort_protocol(original_protocols): def check_profile(filename, overwrite): with open(filename, "r+") as profile: - lines = profile.read().split("\n") + original_profile_str = profile.read() + if not original_profile_str: + return + + lines = original_profile_str.split("\n") was_fixed = False fixed_profile = [] for lineno, original_line in enumerate(lines, 1):