From 8b4ffee007d15662156539fc631d0d2e62181712 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Thu, 19 Sep 2019 12:49:22 -0400 Subject: [PATCH] Fix non-Python3-compliant code in formatter script (#275) * Fix non-Python3-compliant code in formatter script * Add space --- java-format/google-java-format-diff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java-format/google-java-format-diff.py b/java-format/google-java-format-diff.py index f9201bc5c..9eeccced2 100755 --- a/java-format/google-java-format-diff.py +++ b/java-format/google-java-format-diff.py @@ -26,7 +26,7 @@ import difflib import re import string import subprocess -import StringIO +import io import sys from distutils.spawn import find_executable @@ -99,7 +99,7 @@ def main(): # Reformat files containing changes in place. for filename, lines in lines_by_file.iteritems(): if args.i and args.verbose: - print 'Formatting', filename + print('Formatting ' + filename) command = base_command[:] if args.i: command.append('-i') @@ -118,7 +118,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)')