File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env python2.7
1+ #!/usr/bin/env python3
22#
33#===- google-java-format-diff.py - google-java-format Diff Reformatter -----===#
44#
3131import re
3232import string
3333import subprocess
34- import StringIO
34+ import io
3535import sys
3636from distutils .spawn import find_executable
3737
@@ -109,9 +109,9 @@ def main():
109109 base_command = [binary ]
110110
111111 # Reformat files containing changes in place.
112- for filename , lines in lines_by_file .iteritems ():
112+ for filename , lines in lines_by_file .items ():
113113 if args .i and args .verbose :
114- print 'Formatting' , filename
114+ print ( 'Formatting' , filename )
115115 command = base_command [:]
116116 if args .i :
117117 command .append ('-i' )
@@ -134,7 +134,7 @@ def main():
134134 if not args .i :
135135 with open (filename ) as f :
136136 code = f .readlines ()
137- formatted_code = StringIO .StringIO (stdout ).readlines ()
137+ formatted_code = io .StringIO (stdout ).readlines ()
138138 diff = difflib .unified_diff (code , formatted_code ,
139139 filename , filename ,
140140 '(before formatting)' , '(after formatting)' )
You can’t perform that action at this time.
0 commit comments