Skip to content

Commit

Permalink
Convert to Python 3.
Browse files Browse the repository at this point in the history
This was converted using 2to3 from Python 3.7.
  • Loading branch information
tee3 committed Jun 23, 2019
1 parent 16fbcd1 commit 1e14db1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Requirements
Python Implementation
~~~~~~~~~~~~~~~~~~~~~

- Python 2.7
- Python 3.7

C++ Implementation
~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions commands_to_compilation_database_py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions compare_compilation_databases_py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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)
2 changes: 1 addition & 1 deletion files_to_compilation_database_py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 1e14db1

Please sign in to comment.