diff --git a/README.rst b/README.rst index 908b4a7..8bb0895 100644 --- a/README.rst +++ b/README.rst @@ -112,7 +112,7 @@ Requirements Python Implementation ~~~~~~~~~~~~~~~~~~~~~ -- Python 2.7 +- Python 3.7 C++ Implementation ~~~~~~~~~~~~~~~~~~ diff --git a/commands_to_compilation_database_py b/commands_to_compilation_database_py index 5bf5035..37b0e34 100755 --- a/commands_to_compilation_database_py +++ b/commands_to_compilation_database_py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """A program to generate a compilation database by parsing build commands on standard input or an input file. It assumes that a single line compiles a single source file and the clang compiler is used as @@ -107,7 +107,7 @@ if __name__ == '__main__': compile_command_regex = re.compile(r'^"([^"]+)" .+ "([^"]+)"$') else: if args.build_tool != '': - print 'warning: regex overriding build tool option.' + print('warning: regex overriding build tool option.') compile_command_regex = re.compile(args.compile_command_regex) diff --git a/compare_compilation_databases_py b/compare_compilation_databases_py index 2c12c75..fc52001 100755 --- a/compare_compilation_databases_py +++ b/compare_compilation_databases_py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """A program to generate a compilation database by parsing build commands on standard input or an input file. It assumes that a single line compiles a single source file and the clang compiler is used as @@ -75,10 +75,10 @@ if __name__ == '__main__': f1 = args.filenames[1] if not os.path.exists(f0): - print "error: " + f0 + " does not exist." + print(("error: " + f0 + " does not exist.")) sys.exit(1) if not os.path.exists(f1): - print "error: " + f1 + " does not exist." + print(("error: " + f1 + " does not exist.")) sys.exit(1) compilation_map0 = {} @@ -102,12 +102,12 @@ if __name__ == '__main__': keys1 = sorted(compilation_map1.keys()) if len(keys0) != len(keys1): - print "error: compilation databases have different sizes: (%s, %s)." % (len(keys0), len(keys1)) + print(("error: compilation databases have different sizes: (%s, %s)." % (len(keys0), len(keys1)))) sys.exit(1) if keys0 != keys1: - print "error: compilation databases have different keys: (%s, %s)." % (keys0, keys1) + print(("error: compilation databases have different keys: (%s, %s)." % (keys0, keys1))) sys.exit(1) for k in keys0: if compilation_map0[k] != compilation_map1[k]: - print "error: compilation database is different for key %s: (%s, %s)." % (k, compilation_map0[k], compilation_map1[k]) + print(("error: compilation database is different for key %s: (%s, %s)." % (k, compilation_map0[k], compilation_map1[k]))) sys.exit(1) diff --git a/files_to_compilation_database_py b/files_to_compilation_database_py index 0a6dc44..1e3daa9 100755 --- a/files_to_compilation_database_py +++ b/files_to_compilation_database_py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """A program to generate a compilation database given a list of files, one per line.