diff options
author | Georg Brandl <georg@python.org> | 2009-03-31 22:46:50 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-03-31 22:46:50 (GMT) |
commit | 17b9e27abe2148c00f02d9bb1bdff13bc0bed6d0 (patch) | |
tree | bff762ac2720706eb83163204c110fad2f46dd36 /Tools/scripts | |
parent | 369bc0f950aefbe856764f1df3be2ccbdc9c846d (diff) | |
download | cpython-17b9e27abe2148c00f02d9bb1bdff13bc0bed6d0.zip cpython-17b9e27abe2148c00f02d9bb1bdff13bc0bed6d0.tar.gz cpython-17b9e27abe2148c00f02d9bb1bdff13bc0bed6d0.tar.bz2 |
Run 2to3 over new script.
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/reindent-rst.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/scripts/reindent-rst.py b/Tools/scripts/reindent-rst.py index bf431d9..55b99eb 100755 --- a/Tools/scripts/reindent-rst.py +++ b/Tools/scripts/reindent-rst.py @@ -3,7 +3,7 @@ # Make a reST file compliant to our pre-commit hook. # Currently just remove trailing whitespace. -from __future__ import with_statement + import sys, re, shutil ws_re = re.compile(r'\s+(\r?\n)$') @@ -16,12 +16,12 @@ def main(argv=sys.argv): lines = f.readlines() new_lines = [ws_re.sub(r'\1', line) for line in lines] if new_lines != lines: - print 'Fixing %s...' % filename + print('Fixing %s...' % filename) shutil.copyfile(filename, filename + '.bak') with open(filename, 'wb') as f: f.writelines(new_lines) - except Exception, err: - print 'Cannot fix %s: %s' % (filename, err) + except Exception as err: + print('Cannot fix %s: %s' % (filename, err)) rv = 1 return rv |