diff options
author | Georg Brandl <georg@python.org> | 2010-11-26 08:04:57 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-11-26 08:04:57 +0000 |
commit | ef212e0a51707c3ae44a757f7607297150d74154 (patch) | |
tree | 5d50f72d4c1342f70651a8949b84a9a995ae7c33 /Tools/scripts/untabify.py | |
parent | 837fbb0d9a2e2b4ecc828100eef08bf17ac2b61f (diff) | |
download | cpython-git-ef212e0a51707c3ae44a757f7607297150d74154.tar.gz |
Merged revisions 85766-85767 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85766 | georg.brandl | 2010-10-21 09:40:03 +0200 (Do, 21 Okt 2010) | 1 line
#10159: sort completion matches before comparing to dir() result.
........
r85767 | georg.brandl | 2010-10-21 14:49:28 +0200 (Do, 21 Okt 2010) | 1 line
#9095, #8912, #8999: add support in patchcheck for Mercurial checkouts, C file reindenting, and docs whitespace fixing.
........
Diffstat (limited to 'Tools/scripts/untabify.py')
-rwxr-xr-x | Tools/scripts/untabify.py | 10 |
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() |