Merge "update code to be python3-compatible"

This commit is contained in:
Zuul 2018-10-09 20:41:10 +00:00 committed by Gerrit Code Review
commit b6f9528161
3 changed files with 8 additions and 4 deletions

View File

@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from __future__ import print_function
import ast import ast
import argparse import argparse
import importlib import importlib

View File

@ -14,6 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from __future__ import print_function
import re import re
import json import json
import argparse import argparse
@ -194,7 +196,7 @@ with open(args.score_file_name) as filehandle:
# And stdout is useful for folks who are experimenting with # And stdout is useful for folks who are experimenting with
# the effect of changing a score. # the effect of changing a score.
print "%s: %d%s" % (cap_name, total, meets_criteria) print("%s: %d%s" % (cap_name, total, meets_criteria))
# Now we can write the text output file. # Now we can write the text output file.
with open(args.text_outfile_name, 'w') as outfile: with open(args.text_outfile_name, 'w') as outfile:
@ -202,5 +204,5 @@ with open(args.text_outfile_name, 'w') as outfile:
outfile.write(line) outfile.write(line)
outfile.close() outfile.close()
print "\n\nText output has been written to %s" % args.text_outfile_name print("\n\nText output has been written to %s" % args.text_outfile_name)
print "CSV output has been written to %s" % args.csv_outfile_name print("CSV output has been written to %s" % args.csv_outfile_name)