summaryrefslogtreecommitdiffstats
path: root/Tools/patchcheck/untabify.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/patchcheck/untabify.py')
-rwxr-xr-xTools/patchcheck/untabify.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Tools/patchcheck/untabify.py b/Tools/patchcheck/untabify.py
index 861c83c..5c9d120 100755
--- a/Tools/patchcheck/untabify.py
+++ b/Tools/patchcheck/untabify.py
@@ -21,8 +21,7 @@ def main():
if optname == '-t':
tabsize = int(optvalue)
- for filename in args:
- process(filename, tabsize)
+ return max(process(filename, tabsize) for filename in args)
def process(filename, tabsize, verbose=True):
@@ -32,10 +31,10 @@ def process(filename, tabsize, verbose=True):
encoding = f.encoding
except IOError as msg:
print("%r: I/O error: %s" % (filename, msg))
- return
+ return 2
newtext = text.expandtabs(tabsize)
if newtext == text:
- return
+ return 0
backup = filename + "~"
try:
os.unlink(backup)
@@ -49,7 +48,8 @@ def process(filename, tabsize, verbose=True):
f.write(newtext)
if verbose:
print(filename)
+ return 1
if __name__ == '__main__':
- main()
+ raise SystemExit(main())