From ed61e02b24c27b9dad88971ca341b5cd0ae31bd4 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 24 Sep 2011 08:12:26 -0700 Subject: [PATCH] style.py: don't die on empty files --- util/style.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/style.py b/util/style.py index 2b9f654d4..498bdf530 100644 --- a/util/style.py +++ b/util/style.py @@ -233,6 +233,9 @@ class SortedIncludes(Verifier): old = ''.join(line + '\n' for line in lines) f.close() + if len(lines) == 0: + return 0 + language = lang_type(filename, lines[0]) sort_lines = list(self.sort_includes(lines, filename, language)) new = ''.join(line + '\n' for line in sort_lines) -- 2.30.2