mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Fix non-Python3-compliant code in formatter script (#275)
* Fix non-Python3-compliant code in formatter script * Add space
This commit is contained in:
parent
89404dc43d
commit
8b4ffee007
1 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,7 @@ import difflib
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
import subprocess
|
import subprocess
|
||||||
import StringIO
|
import io
|
||||||
import sys
|
import sys
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ def main():
|
||||||
# Reformat files containing changes in place.
|
# Reformat files containing changes in place.
|
||||||
for filename, lines in lines_by_file.iteritems():
|
for filename, lines in lines_by_file.iteritems():
|
||||||
if args.i and args.verbose:
|
if args.i and args.verbose:
|
||||||
print 'Formatting', filename
|
print('Formatting ' + filename)
|
||||||
command = base_command[:]
|
command = base_command[:]
|
||||||
if args.i:
|
if args.i:
|
||||||
command.append('-i')
|
command.append('-i')
|
||||||
|
@ -118,7 +118,7 @@ def main():
|
||||||
if not args.i:
|
if not args.i:
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
code = f.readlines()
|
code = f.readlines()
|
||||||
formatted_code = StringIO.StringIO(stdout).readlines()
|
formatted_code = io.StringIO(stdout).readlines()
|
||||||
diff = difflib.unified_diff(code, formatted_code,
|
diff = difflib.unified_diff(code, formatted_code,
|
||||||
filename, filename,
|
filename, filename,
|
||||||
'(before formatting)', '(after formatting)')
|
'(before formatting)', '(after formatting)')
|
||||||
|
|
Loading…
Add table
Reference in a new issue