Use python3 shebang for all python scripts

The `python` command may not exist on a system with Python 3 installed.
See https://peps.python.org/pep-0394/ for a discussion of the commands
expected to be installed.

Since Python2 was officially sunsetted almost three years ago
(https://www.python.org/doc/sunset-python-2/), IWYU should prefer
compatibility with newer systems over older ones.

Python code in scripts is still Python3/Python2-compatible, but we will no
longer make an effort to preserve Python2 support over time.

Fixes #1096.
This commit is contained in:
Seth R. Johnson 2022-12-16 15:03:39 -05:00 committed by GitHub
parent 616927dec4
commit e4dd555000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- fix_includes.py - rewrite source files based on iwyu output ------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- fix_includes_test.py - test for fix_includes.py ------------------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- iwyu-check-license-header.py - check license headers -------------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- iwyu_test_util.py - include-what-you-use test framework ----------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- iwyu_tool.py -----------------------------------------------------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- iwyu_tool_test.py - test for iwyu_tool.py ------------------------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- iwyu-mapgen-cpython.py -------------------------------------------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- iwyu-mapgen-qt.py ------------------------------------------------===##
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- run_iwyu_tests.py - include-what-you-use test framework driver ---===##
#
@ -52,7 +52,7 @@ def TestIwyuOnRelevantFiles(filename):
glob.glob('%s/*/%s-*' % (dirname, basename)) +
glob.glob('%s.h' % all_but_extension) +
glob.glob('%s/*/%s.h' % (dirname, basename)))
files_to_check = [f for f in all_files if not f.endswith(extension)]
files_to_check.append(filename)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
##===--- scrub-logs.py - generate README from Wiki sources ----------------===##
#