projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40b6c9c
)
style.py: don't die on empty files
author
Steve Reinhardt
<steve.reinhardt@amd.com>
Sat, 24 Sep 2011 15:12:26 +0000
(08:12 -0700)
committer
Steve Reinhardt
<steve.reinhardt@amd.com>
Sat, 24 Sep 2011 15:12:26 +0000
(08:12 -0700)
util/style.py
patch
|
blob
|
history
diff --git
a/util/style.py
b/util/style.py
index 2b9f654d4554a3c7a1267a08c857c6061bd3520b..498bdf530073a2b5d4d4769e7cc440e1118b273b 100644
(file)
--- 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)