4545
4646def usage (msg = None ):
4747 if msg is not None :
48- print >> sys .stderr , msg
49- print >> sys .stderr , __doc__
48+ print ( msg , file = sys .stderr )
49+ print ( __doc__ , file = sys .stderr )
5050
5151def errprint (* args ):
5252 sep = ""
@@ -85,7 +85,7 @@ def main():
8585def check (file ):
8686 if os .path .isdir (file ) and not os .path .islink (file ):
8787 if verbose :
88- print "listing directory" , file
88+ print ( "listing directory" , file )
8989 names = os .listdir (file )
9090 for name in names :
9191 fullname = os .path .join (file , name )
@@ -96,7 +96,7 @@ def check(file):
9696 return
9797
9898 if verbose :
99- print "checking" , file , "..." ,
99+ print ( "checking" , file , "..." , end = ' ' )
100100 try :
101101 f = open (file )
102102 except IOError as msg :
@@ -107,24 +107,24 @@ def check(file):
107107 f .close ()
108108 if r .run ():
109109 if verbose :
110- print "changed."
110+ print ( "changed." )
111111 if dryrun :
112- print "But this is a dry run, so leaving it alone."
112+ print ( "But this is a dry run, so leaving it alone." )
113113 if not dryrun :
114114 bak = file + ".bak"
115115 if os .path .exists (bak ):
116116 os .remove (bak )
117117 os .rename (file , bak )
118118 if verbose :
119- print "renamed" , file , "to" , bak
119+ print ( "renamed" , file , "to" , bak )
120120 f = open (file , "w" )
121121 r .write (f )
122122 f .close ()
123123 if verbose :
124- print "wrote new" , file
124+ print ( "wrote new" , file )
125125 else :
126126 if verbose :
127- print "unchanged."
127+ print ( "unchanged." )
128128
129129def _rstrip (line , JUNK = '\n \t ' ):
130130 """Return line stripped of trailing spaces, tabs, newlines.
0 commit comments