diff --git a/scripts/google-java-format-diff.py b/scripts/google-java-format-diff.py index cf2ded9ec..63f1d2fc4 100755 --- a/scripts/google-java-format-diff.py +++ b/scripts/google-java-format-diff.py @@ -134,11 +134,11 @@ def main(): if not args.i: with open(filename) as f: code = f.readlines() - formatted_code = io.StringIO(stdout).readlines() + formatted_code = io.StringIO(stdout.decode('utf-8')).readlines() diff = difflib.unified_diff(code, formatted_code, filename, filename, '(before formatting)', '(after formatting)') - diff_string = string.join(diff, '') + diff_string = ''.join(diff) if len(diff_string) > 0: sys.stdout.write(diff_string)