Skip to content

Run 2to3 on google-java-format-diff.py #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scripts/google-java-format-diff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python3
#
#===- google-java-format-diff.py - google-java-format Diff Reformatter -----===#
#
Expand Down Expand Up @@ -31,7 +31,7 @@
import re
import string
import subprocess
import StringIO
import io
import sys
from distutils.spawn import find_executable

Expand Down Expand Up @@ -109,9 +109,9 @@ def main():
base_command = [binary]

# Reformat files containing changes in place.
for filename, lines in lines_by_file.iteritems():
for filename, lines in lines_by_file.items():
if args.i and args.verbose:
print 'Formatting', filename
print('Formatting', filename)
command = base_command[:]
if args.i:
command.append('-i')
Expand All @@ -134,7 +134,7 @@ def main():
if not args.i:
with open(filename) as f:
code = f.readlines()
formatted_code = StringIO.StringIO(stdout).readlines()
formatted_code = io.StringIO(stdout).readlines()
diff = difflib.unified_diff(code, formatted_code,
filename, filename,
'(before formatting)', '(after formatting)')
Expand Down