From: Steve Reinhardt Date: Sat, 24 Sep 2011 15:12:26 +0000 (-0700) Subject: style.py: don't die on empty files X-Git-Tag: stable_2012_02_02~52 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed61e02b24c27b9dad88971ca341b5cd0ae31bd4;p=gem5.git style.py: don't die on empty files --- 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)