]> granicus.if.org Git - python/commitdiff
Run 2to3 over new script.
authorGeorg Brandl <georg@python.org>
Tue, 31 Mar 2009 22:46:50 +0000 (22:46 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 31 Mar 2009 22:46:50 +0000 (22:46 +0000)
Tools/scripts/reindent-rst.py

index bf431d956cdc6623125e6b2971ac2499f641ffa6..55b99ebabad8c93ded8507e2bfa87e337371e186 100755 (executable)
@@ -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