From fd928da46e26b5f983afdeba2b80685b615dbae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 4 Jan 2016 20:22:13 +0100 Subject: [PATCH] Fix python3 incompatibilities in make_dafsa.py --- src/make_dafsa.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/make_dafsa.py b/src/make_dafsa.py index bb308f6..41df88b 100755 --- a/src/make_dafsa.py +++ b/src/make_dafsa.py @@ -501,7 +501,7 @@ def parse_psl(infile): line = line[1:] elif line[0] == '*': if line[1] != '.': - print 'Unsupported kind of rule (ignored): %s' % line + print('Unsupported kind of rule (ignored): %s', line) continue flags = PSL_FLAG_WILDCARD | PSL_FLAG_PLAIN | section line = line[2:] @@ -536,11 +536,11 @@ def parse_psl(infile): def usage(): """Prints the usage""" - print 'usage: %s [options] infile outfile' % sys.argv[0] - print ' --input-format=psl2c infile has been generated by libpsl/psl2c utility (default)' - print ' --input-format=psl infile is a Public Suffix List file' - print ' --output-format=cxx Write DAFSA as C/C++ code' - print ' --output-format=binary Write DAFSA binary data' + print('usage: %s [options] infile outfile', sys.argv[0]) + print(' --input-format=psl2c infile has been generated by libpsl/psl2c utility (default)') + print(' --input-format=psl infile is a Public Suffix List file') + print(' --output-format=cxx Write DAFSA as C/C++ code') + print(' --output-format=binary Write DAFSA binary data') exit(1) @@ -560,7 +560,7 @@ def main(): elif value == 'psl2c': parser = parse_psl2c else: - print "Unknown input format '%s'" % value + print("Unknown input format '%s'", value) return 1 elif arg.startswith('--output-format='): value = arg[16:].lower() @@ -569,7 +569,7 @@ def main(): elif value == 'cxx': converter = words_to_cxx else: - print "Unknown output format '%s'" % value + print("Unknown output format '%s'", value) return 1 else: usage()