summaryrefslogtreecommitdiff
path: root/Tools/scripts/untabify.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/scripts/untabify.py')
-rwxr-xr-xTools/scripts/untabify.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Tools/scripts/untabify.py b/Tools/scripts/untabify.py
index 9bdf235b67..83e73da825 100755
--- a/Tools/scripts/untabify.py
+++ b/Tools/scripts/untabify.py
@@ -23,7 +23,7 @@ def main():
for filename in args:
process(filename, tabsize)
-def process(filename, tabsize):
+def process(filename, tabsize, verbose=True):
try:
f = open(filename)
text = f.read()
@@ -43,10 +43,10 @@ def process(filename, tabsize):
os.rename(filename, backup)
except os.error:
pass
- f = open(filename, "w")
- f.write(newtext)
- f.close()
- print filename
+ with open(filename, "w") as f:
+ f.write(newtext)
+ if verbose:
+ print filename
if __name__ == '__main__':
main()