[libcxx-commits] [clang] [clang-tools-extra] [compiler-rt] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [openmp] [polly] Python-related cleanups (PR #163566)
Ross Burton via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 15 07:34:24 PDT 2025
https://github.com/rossburton created https://github.com/llvm/llvm-project/pull/163566
Ensure that the nested native CMake build uses the same Python interpreter as the outer build.
Unify python shebangs so that they use `python3` everywhere, instead of a mix of `python` and `python3`.
>From 19f755003adf1befbbbbe663543286950fb4ac3a Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton at arm.com>
Date: Wed, 15 Oct 2025 15:21:16 +0100
Subject: [PATCH 1/2] [cmake] Pass PYTHON_EXECUTABLE to native builds
Ensure that the nested native build uses the same python interpreter as
the main build, in case the python that CMake detects first is not the
python that the user has specified explicitly.
Original fix by Anuj Mittal <anuj.mittal at intel.com>.
---
llvm/cmake/modules/CrossCompile.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index bfbd9cfd4063f..2a69c5133c56f 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -101,6 +101,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
-DLLVM_INCLUDE_BENCHMARKS=OFF
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TABLEGEN_FLAGS="${LLVM_TABLEGEN_FLAGS}"
+ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}"
${build_type_flags} ${linker_flag} ${external_clang_dir} ${libc_flags}
${ARGN}
WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD}
>From 464199d55480a8cf5b12b13375b35bc6429ea24c Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton at arm.com>
Date: Wed, 15 Oct 2025 15:04:40 +0100
Subject: [PATCH 2/2] Unify python shebangs
As per PEP-0394[1], there is no real concensus over what binary names
Python has, specifically 'python' could be Python 3, Python 2, or not
exist.
However, everyone has a python3 interpreter and the scripts are all
written for Python 3. Unify the shebangs so that the ~50% of shebangs
that use python now use python3.
[1] https://peps.python.org/pep-0394/
---
.../find-all-symbols/tool/run-find-all-symbols.py | 2 +-
clang-tools-extra/clangd/test/remote-index/pipeline_helper.py | 2 +-
clang/bindings/python/examples/cindex/cindex-dump.py | 2 +-
clang/bindings/python/examples/cindex/cindex-includes.py | 2 +-
clang/docs/tools/generate_formatted_state.py | 2 +-
clang/test/Analysis/check-analyzer-fixit.py | 2 +-
clang/test/Analysis/csv2json.py | 2 +-
clang/test/Driver/ftime-trace-sections.py | 2 +-
clang/tools/include-mapping/test.py | 2 +-
clang/tools/scan-build/bin/set-xcode-analyzer | 2 +-
clang/tools/scan-view/bin/scan-view | 2 +-
clang/tools/scan-view/share/Reporter.py | 2 +-
clang/tools/scan-view/share/startfile.py | 2 +-
clang/utils/ABITest/ABITestGen.py | 2 +-
clang/utils/CIndex/completion_logger_server.py | 2 +-
clang/utils/CaptureCmd | 2 +-
clang/utils/CmpDriver | 2 +-
clang/utils/FindSpecRefs | 2 +-
clang/utils/FuzzTest | 2 +-
clang/utils/TestUtils/deep-stack.py | 2 +-
clang/utils/analyzer/CmpRuns.py | 2 +-
clang/utils/analyzer/SATest.py | 2 +-
clang/utils/analyzer/SATestAdd.py | 2 +-
clang/utils/analyzer/SATestBuild.py | 2 +-
clang/utils/analyzer/SATestUpdateDiffs.py | 2 +-
clang/utils/analyzer/SumTimerInfo.py | 2 +-
clang/utils/analyzer/exploded-graph-rewriter.py | 2 +-
clang/utils/check_cfc/check_cfc.py | 2 +-
clang/utils/check_cfc/obj_diff.py | 2 +-
clang/utils/check_cfc/test_check_cfc.py | 2 +-
clang/utils/clangdiag.py | 2 +-
clang/utils/modfuzz.py | 2 +-
clang/utils/token-delta.py | 2 +-
clang/www/builtins.py | 2 +-
compiler-rt/lib/asan/scripts/asan_symbolize.py | 2 +-
compiler-rt/lib/fuzzer/scripts/unbalanced_allocs.py | 2 +-
compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py | 2 +-
compiler-rt/lib/sanitizer_common/scripts/sancov.py | 2 +-
cross-project-tests/debuginfo-tests/dexter/dexter.py | 2 +-
libc/AOR_v20.02/math/tools/plot.py | 2 +-
libc/utils/docgen/docgen.py | 2 +-
libcxx/test/libcxx-03/transitive_includes/to_csv.py | 2 +-
libcxx/test/libcxx/transitive_includes/to_csv.py | 2 +-
libcxx/utils/generate_abi_list.py | 2 +-
libcxx/utils/generate_escaped_output_table.py | 2 +-
libcxx/utils/generate_extended_grapheme_cluster_table.py | 2 +-
libcxx/utils/generate_extended_grapheme_cluster_test.py | 2 +-
libcxx/utils/generate_feature_test_macro_components.py | 2 +-
libcxx/utils/generate_indic_conjunct_break_table.py | 2 +-
libcxx/utils/generate_iwyu_mapping.py | 2 +-
libcxx/utils/generate_width_estimation_table.py | 2 +-
libcxx/utils/run.py | 2 +-
libcxx/utils/ssh.py | 2 +-
libcxx/utils/sym_diff.py | 2 +-
lld/test/MachO/tools/generate-cfi-funcs.py | 2 +-
lld/test/MachO/tools/validate-unwind-info.py | 2 +-
lld/utils/benchmark.py | 2 +-
lldb/docs/use/tutorials/writing-custom-commands.md | 2 +-
lldb/examples/python/armv7_cortex_m_target_defintion.py | 2 +-
lldb/examples/python/bsd.py | 2 +-
lldb/examples/python/cmdtemplate.py | 2 +-
lldb/examples/python/delta.py | 2 +-
lldb/examples/python/disasm-stress-test.py | 2 +-
lldb/examples/python/disasm.py | 2 +-
lldb/examples/python/file_extract.py | 2 +-
lldb/examples/python/gdbremote.py | 2 +-
lldb/examples/python/globals.py | 2 +-
lldb/examples/python/in_call_stack.py | 2 +-
lldb/examples/python/lldb_module_utils.py | 2 +-
lldb/examples/python/lldbtk.py | 2 +-
lldb/examples/python/mach_o.py | 2 +-
lldb/examples/python/memory.py | 2 +-
lldb/examples/python/operating_system.py | 2 +-
lldb/examples/python/performance.py | 2 +-
lldb/examples/python/process_events.py | 2 +-
lldb/examples/python/sbvalue.py | 2 +-
lldb/examples/python/shadow.py | 2 +-
lldb/examples/python/sources.py | 2 +-
lldb/examples/python/stacks.py | 2 +-
lldb/examples/python/symbolication.py | 2 +-
lldb/examples/python/types.py | 2 +-
lldb/examples/python/x86_64_linux_target_definition.py | 2 +-
lldb/examples/python/x86_64_qemu_target_definition.py | 2 +-
lldb/examples/python/x86_64_target_definition.py | 2 +-
.../packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py | 2 +-
lldb/scripts/analyze-project-deps.py | 2 +-
lldb/scripts/verify_api.py | 2 +-
lldb/test/API/dotest.py | 2 +-
.../plugins/python_os_plugin/operating_system2.py | 2 +-
.../python_os_plugin/os_plugin_in_dsym/operating_system.py | 2 +-
.../stepping_plugin_threads/operating_system.py | 2 +-
.../postmortem/FreeBSDKernel/tools/copy-sparse.py | 2 +-
lldb/test/API/test_runner/test/inferior.py | 2 +-
lldb/test/API/test_runner/test/test_process_control.py | 2 +-
lldb/test/Shell/Quit/expect_exit_code.py | 2 +-
lldb/test/Shell/Register/Core/Inputs/strip-coredump.py | 2 +-
.../Shell/ScriptInterpreter/Python/Crashlog/patch-crashlog.py | 2 +-
lldb/test/Shell/helper/build.py | 2 +-
lldb/utils/lui/lui.py | 2 +-
lldb/utils/lui/sandbox.py | 2 +-
llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py | 2 +-
llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py | 2 +-
llvm/examples/Kaleidoscope/MCJIT/complete/genk-timing.py | 2 +-
llvm/examples/Kaleidoscope/MCJIT/complete/split-lib.py | 2 +-
llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | 2 +-
llvm/test/BugPoint/compile-custom.ll.py | 2 +-
llvm/test/Other/opt-bisect-helper.py | 2 +-
llvm/test/TableGen/JSON-check.py | 2 +-
llvm/tools/opt-viewer/extract-reproducers.py | 2 +-
llvm/tools/opt-viewer/opt-diff.py | 2 +-
llvm/tools/opt-viewer/opt-stats.py | 2 +-
llvm/tools/opt-viewer/opt-viewer.py | 2 +-
llvm/tools/opt-viewer/optrecord.py | 2 +-
llvm/utils/DSAclean.py | 2 +-
llvm/utils/DSAextract.py | 2 +-
llvm/utils/Misc/zkill | 2 +-
llvm/utils/Reviewing/find_interesting_reviews.py | 2 +-
llvm/utils/Target/ARM/analyze-match-table.py | 2 +-
llvm/utils/abtest.py | 2 +-
llvm/utils/bisect | 2 +-
llvm/utils/bugpoint_gisel_reducer.py | 2 +-
llvm/utils/chunk-print-before-all.py | 2 +-
llvm/utils/clang-parse-diagnostics-file | 2 +-
llvm/utils/convert-constraint-log-to-z3.py | 2 +-
llvm/utils/create_ladder_graph.py | 2 +-
llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py | 2 +-
llvm/utils/extract-section.py | 2 +-
llvm/utils/extract_symbols.py | 2 +-
llvm/utils/extract_vplan.py | 2 +-
llvm/utils/indirect_calls.py | 2 +-
llvm/utils/lint/common_lint.py | 2 +-
llvm/utils/lint/cpp_lint.py | 2 +-
llvm/utils/lint/generic_lint.py | 2 +-
llvm/utils/lit/lit/ProgressBar.py | 2 +-
llvm/utils/lit/tests/Inputs/check_path.py | 2 +-
llvm/utils/lit/tests/Inputs/fake-externals/cd | 2 +-
llvm/utils/lit/tests/Inputs/fake-externals/diff | 2 +-
llvm/utils/lit/tests/Inputs/fake-externals/env | 2 +-
llvm/utils/lit/tests/Inputs/fake-externals/export | 2 +-
llvm/utils/lit/tests/Inputs/fake-externals/mkdir | 2 +-
llvm/utils/lit/tests/Inputs/fake-externals/rm | 2 +-
.../lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py | 2 +-
.../Inputs/googletest-detect-duplicate/DummySubDir/OneTest.py | 2 +-
.../tests/Inputs/googletest-discovery-failed/subdir/OneTest.py | 2 +-
.../DummySubDir/OneTest.py | 2 +-
.../lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py | 2 +-
.../tests/Inputs/googletest-no-sharding/DummySubDir/OneTest.py | 2 +-
.../lit/tests/Inputs/googletest-prefix/DummySubDir/test_one.py | 2 +-
.../Inputs/googletest-sanitizer-error/DummySubDir/OneTest.py | 2 +-
.../lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py | 2 +-
.../Inputs/shtest-format/external_shell/write-bad-encoding.py | 2 +-
.../Inputs/shtest-format/external_shell/write-control-chars.py | 2 +-
llvm/utils/lit/tests/Inputs/shtest-not/fail.py | 2 +-
llvm/utils/lit/tests/Inputs/shtest-not/fail2.py | 2 +-
llvm/utils/lit/tests/Inputs/shtest-not/pass.py | 2 +-
.../lit/tests/Inputs/shtest-output-printing/write-a-lot.py | 2 +-
llvm/utils/lit/tests/Inputs/shtest-shell/check_args.py | 2 +-
llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py | 2 +-
.../lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py | 2 +-
llvm/utils/llvm-gisel-cov.py | 2 +-
llvm/utils/llvm-original-di-preservation.py | 2 +-
llvm/utils/merge-json.py | 2 +-
llvm/utils/prepare-code-coverage-artifact.py | 2 +-
llvm/utils/release/findRegressions-nightly.py | 2 +-
llvm/utils/release/findRegressions-simple.py | 2 +-
llvm/utils/remote-exec.py | 2 +-
llvm/utils/schedcover.py | 2 +-
llvm/utils/shuffle_fuzz.py | 2 +-
llvm/utils/shuffle_select_fuzz_tester.py | 2 +-
llvm/utils/sort_includes.py | 2 +-
llvm/utils/testgen/mc-bundling-x86-gen.py | 2 +-
llvm/utils/unicode-case-fold.py | 2 +-
llvm/utils/wciia.py | 2 +-
mlir/utils/lldb-scripts/action_debugging.py | 2 +-
openmp/runtime/tools/summarizeStats.py | 2 +-
polly/lib/External/isl/imath/tests/gmp-compat-test/genctest.py | 2 +-
polly/lib/External/isl/imath/tests/gmp-compat-test/gendata.py | 2 +-
polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py | 2 +-
polly/lib/External/isl/imath/tests/gmp-compat-test/gmpapi.py | 2 +-
polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py | 2 +-
polly/lib/External/isl/imath/tools/findthreshold.py | 2 +-
polly/lib/External/isl/imath/tools/mkdoc.py | 2 +-
polly/utils/jscop2cloog.py | 2 +-
polly/utils/pyscop/jscop2iscc.py | 2 +-
184 files changed, 184 insertions(+), 184 deletions(-)
diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
index 49a1b14932644..6158876d15f76 100755
--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# =- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=#
#
diff --git a/clang-tools-extra/clangd/test/remote-index/pipeline_helper.py b/clang-tools-extra/clangd/test/remote-index/pipeline_helper.py
index afdac985221a7..c9432341d304a 100644
--- a/clang-tools-extra/clangd/test/remote-index/pipeline_helper.py
+++ b/clang-tools-extra/clangd/test/remote-index/pipeline_helper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# ===- pipeline_helper.py - Remote Index pipeline Helper *- python -------*--===#
#
diff --git a/clang/bindings/python/examples/cindex/cindex-dump.py b/clang/bindings/python/examples/cindex/cindex-dump.py
index 10c3e4ba2dba4..79d3441e87fad 100644
--- a/clang/bindings/python/examples/cindex/cindex-dump.py
+++ b/clang/bindings/python/examples/cindex/cindex-dump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===- cindex-dump.py - cindex/Python Source Dump -------------*- python -*--===#
#
diff --git a/clang/bindings/python/examples/cindex/cindex-includes.py b/clang/bindings/python/examples/cindex/cindex-includes.py
index 4e8bae19005cd..0b021f4554f59 100644
--- a/clang/bindings/python/examples/cindex/cindex-includes.py
+++ b/clang/bindings/python/examples/cindex/cindex-includes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===#
#
diff --git a/clang/docs/tools/generate_formatted_state.py b/clang/docs/tools/generate_formatted_state.py
index 2de43dc383f55..f857320ada1b7 100755
--- a/clang/docs/tools/generate_formatted_state.py
+++ b/clang/docs/tools/generate_formatted_state.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# A tool to parse creates a document outlining how clang formatted the
# LLVM project is.
diff --git a/clang/test/Analysis/check-analyzer-fixit.py b/clang/test/Analysis/check-analyzer-fixit.py
index b616255de89b0..5c19461fd5d82 100644
--- a/clang/test/Analysis/check-analyzer-fixit.py
+++ b/clang/test/Analysis/check-analyzer-fixit.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# ===- check-analyzer-fixit.py - Static Analyzer test helper ---*- python -*-===#
#
diff --git a/clang/test/Analysis/csv2json.py b/clang/test/Analysis/csv2json.py
index 6e1aca9a51779..642610140153e 100644
--- a/clang/test/Analysis/csv2json.py
+++ b/clang/test/Analysis/csv2json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# ===- csv2json.py - Static Analyzer test helper ---*- python -*-===#
#
diff --git a/clang/test/Driver/ftime-trace-sections.py b/clang/test/Driver/ftime-trace-sections.py
index 02afa4ac54eb7..46248e546d94a 100644
--- a/clang/test/Driver/ftime-trace-sections.py
+++ b/clang/test/Driver/ftime-trace-sections.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import json, sys, time
diff --git a/clang/tools/include-mapping/test.py b/clang/tools/include-mapping/test.py
index 81803855dac8f..7293b5a19d883 100755
--- a/clang/tools/include-mapping/test.py
+++ b/clang/tools/include-mapping/test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===- test.py - ---------------------------------------------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/clang/tools/scan-build/bin/set-xcode-analyzer b/clang/tools/scan-build/bin/set-xcode-analyzer
index 8e4a5794594a6..5d52c96c59052 100755
--- a/clang/tools/scan-build/bin/set-xcode-analyzer
+++ b/clang/tools/scan-build/bin/set-xcode-analyzer
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# [PR 11661] Note that we hardwire to /usr/bin/python because we
# want to the use the system version of Python on Mac OS X.
diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view
index d01aebb4029a7..f3375804654d2 100755
--- a/clang/tools/scan-view/bin/scan-view
+++ b/clang/tools/scan-view/bin/scan-view
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/clang/tools/scan-view/share/Reporter.py b/clang/tools/scan-view/share/Reporter.py
index 21874b378687e..aa16a47524c8b 100644
--- a/clang/tools/scan-view/share/Reporter.py
+++ b/clang/tools/scan-view/share/Reporter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Methods for reporting bugs."""
diff --git a/clang/tools/scan-view/share/startfile.py b/clang/tools/scan-view/share/startfile.py
index c72475e8b6212..a10df214d0046 100644
--- a/clang/tools/scan-view/share/startfile.py
+++ b/clang/tools/scan-view/share/startfile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Utility for opening a file using the default application in a cross-platform
diff --git a/clang/utils/ABITest/ABITestGen.py b/clang/utils/ABITest/ABITestGen.py
index 119b3299ffa60..b04cc3d29d8d8 100755
--- a/clang/utils/ABITest/ABITestGen.py
+++ b/clang/utils/ABITest/ABITestGen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
from pprint import pprint
diff --git a/clang/utils/CIndex/completion_logger_server.py b/clang/utils/CIndex/completion_logger_server.py
index ff33331fc53c5..5888fb10fc768 100755
--- a/clang/utils/CIndex/completion_logger_server.py
+++ b/clang/utils/CIndex/completion_logger_server.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import sys
from socket import *
diff --git a/clang/utils/CaptureCmd b/clang/utils/CaptureCmd
index 705585c3bb041..5ffdfe560edf0 100755
--- a/clang/utils/CaptureCmd
+++ b/clang/utils/CaptureCmd
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""CaptureCmd - A generic tool for capturing information about the
invocations of another program.
diff --git a/clang/utils/CmpDriver b/clang/utils/CmpDriver
index 12ce7a3250f66..c2b6ab5ecb1aa 100755
--- a/clang/utils/CmpDriver
+++ b/clang/utils/CmpDriver
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
A simple utility that compares tool invocations and exit codes issued by
diff --git a/clang/utils/FindSpecRefs b/clang/utils/FindSpecRefs
index 9097f93f28d63..3ad581b3dd7d1 100755
--- a/clang/utils/FindSpecRefs
+++ b/clang/utils/FindSpecRefs
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import re
diff --git a/clang/utils/FuzzTest b/clang/utils/FuzzTest
index 0e043df7cf08e..c4c956b6eb501 100755
--- a/clang/utils/FuzzTest
+++ b/clang/utils/FuzzTest
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
This is a generic fuzz testing tool, see --help for more information.
diff --git a/clang/utils/TestUtils/deep-stack.py b/clang/utils/TestUtils/deep-stack.py
index 4cf5789abdb12..85376dcedc280 100755
--- a/clang/utils/TestUtils/deep-stack.py
+++ b/clang/utils/TestUtils/deep-stack.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
diff --git a/clang/utils/analyzer/CmpRuns.py b/clang/utils/analyzer/CmpRuns.py
index 94c9907bff315..76444d2a44580 100644
--- a/clang/utils/analyzer/CmpRuns.py
+++ b/clang/utils/analyzer/CmpRuns.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
CmpRuns - A simple tool for comparing two static analyzer runs to determine
diff --git a/clang/utils/analyzer/SATest.py b/clang/utils/analyzer/SATest.py
index d70e33f24c2df..8b07effd8b83b 100755
--- a/clang/utils/analyzer/SATest.py
+++ b/clang/utils/analyzer/SATest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import sys
diff --git a/clang/utils/analyzer/SATestAdd.py b/clang/utils/analyzer/SATestAdd.py
index 84e6d44b42822..05bebabb3601b 100644
--- a/clang/utils/analyzer/SATestAdd.py
+++ b/clang/utils/analyzer/SATestAdd.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Static Analyzer qualification infrastructure: adding a new project to
diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py
index 66e1ab72985cd..ff1a42de2c569 100644
--- a/clang/utils/analyzer/SATestBuild.py
+++ b/clang/utils/analyzer/SATestBuild.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Static Analyzer qualification infrastructure.
diff --git a/clang/utils/analyzer/SATestUpdateDiffs.py b/clang/utils/analyzer/SATestUpdateDiffs.py
index 1c5ffaaa2e330..e1416510d0178 100644
--- a/clang/utils/analyzer/SATestUpdateDiffs.py
+++ b/clang/utils/analyzer/SATestUpdateDiffs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Update reference results for static analyzer.
diff --git a/clang/utils/analyzer/SumTimerInfo.py b/clang/utils/analyzer/SumTimerInfo.py
index 01614e41a065c..9772bff335f4b 100644
--- a/clang/utils/analyzer/SumTimerInfo.py
+++ b/clang/utils/analyzer/SumTimerInfo.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Script to Summarize statistics in the scan-build output.
diff --git a/clang/utils/analyzer/exploded-graph-rewriter.py b/clang/utils/analyzer/exploded-graph-rewriter.py
index dcda91e8a6809..9198fcbfd184e 100755
--- a/clang/utils/analyzer/exploded-graph-rewriter.py
+++ b/clang/utils/analyzer/exploded-graph-rewriter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# ===- exploded-graph-rewriter.py - ExplodedGraph dump tool -----*- python -*--#
#
diff --git a/clang/utils/check_cfc/check_cfc.py b/clang/utils/check_cfc/check_cfc.py
index 8d42ec532bbb7..6b793937a5d08 100755
--- a/clang/utils/check_cfc/check_cfc.py
+++ b/clang/utils/check_cfc/check_cfc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Check CFC - Check Compile Flow Consistency
diff --git a/clang/utils/check_cfc/obj_diff.py b/clang/utils/check_cfc/obj_diff.py
index 9d602593a4e1a..02e0ebdf0efcd 100755
--- a/clang/utils/check_cfc/obj_diff.py
+++ b/clang/utils/check_cfc/obj_diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
diff --git a/clang/utils/check_cfc/test_check_cfc.py b/clang/utils/check_cfc/test_check_cfc.py
index cd4441b702cde..a23ad2ccbee41 100755
--- a/clang/utils/check_cfc/test_check_cfc.py
+++ b/clang/utils/check_cfc/test_check_cfc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Test internal functions within check_cfc.py."""
diff --git a/clang/utils/clangdiag.py b/clang/utils/clangdiag.py
index 8c47b1cbcfff3..e4b94e5757cbc 100755
--- a/clang/utils/clangdiag.py
+++ b/clang/utils/clangdiag.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/clang/utils/modfuzz.py b/clang/utils/modfuzz.py
index 49ac522cd17e1..7c00102c2cca5 100644
--- a/clang/utils/modfuzz.py
+++ b/clang/utils/modfuzz.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# To use:
# 1) Update the 'decls' list below with your fuzzing configuration.
diff --git a/clang/utils/token-delta.py b/clang/utils/token-delta.py
index 7c2375c03013f..4fe5798033f41 100755
--- a/clang/utils/token-delta.py
+++ b/clang/utils/token-delta.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import os
diff --git a/clang/www/builtins.py b/clang/www/builtins.py
index 849e6bd4a816d..235de1a157cd1 100755
--- a/clang/www/builtins.py
+++ b/clang/www/builtins.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys, fileinput
diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py
index 8ecd66c745119..f60a8307ec60e 100755
--- a/compiler-rt/lib/asan/scripts/asan_symbolize.py
+++ b/compiler-rt/lib/asan/scripts/asan_symbolize.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===- lib/asan/scripts/asan_symbolize.py -----------------------------------===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/compiler-rt/lib/fuzzer/scripts/unbalanced_allocs.py b/compiler-rt/lib/fuzzer/scripts/unbalanced_allocs.py
index 7ba7e09cb4e50..c8c19a017eb3f 100755
--- a/compiler-rt/lib/fuzzer/scripts/unbalanced_allocs.py
+++ b/compiler-rt/lib/fuzzer/scripts/unbalanced_allocs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===- lib/fuzzer/scripts/unbalanced_allocs.py ------------------------------===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py b/compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py
index fdbceae165e0d..e4b33e6637b0e 100755
--- a/compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py
+++ b/compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===- lib/sanitizer_common/scripts/gen_dynamic_list.py ---------------------===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/compiler-rt/lib/sanitizer_common/scripts/sancov.py b/compiler-rt/lib/sanitizer_common/scripts/sancov.py
index 31055086350ab..06906aabf18e8 100755
--- a/compiler-rt/lib/sanitizer_common/scripts/sancov.py
+++ b/compiler-rt/lib/sanitizer_common/scripts/sancov.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Merge or print the coverage data collected by asan's coverage.
# Input files are sequences of 4-byte integers.
# We need to merge these integers into a set and then
diff --git a/cross-project-tests/debuginfo-tests/dexter/dexter.py b/cross-project-tests/debuginfo-tests/dexter/dexter.py
index 8473cff3c7135..ac507dc2f5ee0 100755
--- a/cross-project-tests/debuginfo-tests/dexter/dexter.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dexter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
diff --git a/libc/AOR_v20.02/math/tools/plot.py b/libc/AOR_v20.02/math/tools/plot.py
index 9ce6b0308dd57..4bbd866993c89 100755
--- a/libc/AOR_v20.02/math/tools/plot.py
+++ b/libc/AOR_v20.02/math/tools/plot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ULP error plot tool.
#
diff --git a/libc/utils/docgen/docgen.py b/libc/utils/docgen/docgen.py
index 5a57987b3c51e..59cfbd54561c7 100755
--- a/libc/utils/docgen/docgen.py
+++ b/libc/utils/docgen/docgen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# ====- Generate documentation for libc functions ------------*- python -*--==#
#
diff --git a/libcxx/test/libcxx-03/transitive_includes/to_csv.py b/libcxx/test/libcxx-03/transitive_includes/to_csv.py
index 69d94deedf6f5..658aa6e657632 100755
--- a/libcxx/test/libcxx-03/transitive_includes/to_csv.py
+++ b/libcxx/test/libcxx-03/transitive_includes/to_csv.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/test/libcxx/transitive_includes/to_csv.py b/libcxx/test/libcxx/transitive_includes/to_csv.py
index 69d94deedf6f5..658aa6e657632 100755
--- a/libcxx/test/libcxx/transitive_includes/to_csv.py
+++ b/libcxx/test/libcxx/transitive_includes/to_csv.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/generate_abi_list.py b/libcxx/utils/generate_abi_list.py
index 94e49dca60af1..5e99b14bec72e 100755
--- a/libcxx/utils/generate_abi_list.py
+++ b/libcxx/utils/generate_abi_list.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/generate_escaped_output_table.py b/libcxx/utils/generate_escaped_output_table.py
index 59dd707ae6126..6be7d128ed5f1 100755
--- a/libcxx/utils/generate_escaped_output_table.py
+++ b/libcxx/utils/generate_escaped_output_table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/generate_extended_grapheme_cluster_table.py b/libcxx/utils/generate_extended_grapheme_cluster_table.py
index eba88a4f48776..7bfb4f41520c7 100755
--- a/libcxx/utils/generate_extended_grapheme_cluster_table.py
+++ b/libcxx/utils/generate_extended_grapheme_cluster_table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/generate_extended_grapheme_cluster_test.py b/libcxx/utils/generate_extended_grapheme_cluster_test.py
index e0a6003ecd53c..29a3e14014e8d 100755
--- a/libcxx/utils/generate_extended_grapheme_cluster_test.py
+++ b/libcxx/utils/generate_extended_grapheme_cluster_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index f6f252751b3e3..5c9893bf2c742 100644
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
from builtins import range
diff --git a/libcxx/utils/generate_indic_conjunct_break_table.py b/libcxx/utils/generate_indic_conjunct_break_table.py
index 580d8157ffebf..4ecb9a135948b 100755
--- a/libcxx/utils/generate_indic_conjunct_break_table.py
+++ b/libcxx/utils/generate_indic_conjunct_break_table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/generate_iwyu_mapping.py b/libcxx/utils/generate_iwyu_mapping.py
index ab3e3f14e14d8..35da70f62f264 100644
--- a/libcxx/utils/generate_iwyu_mapping.py
+++ b/libcxx/utils/generate_iwyu_mapping.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import libcxx.header_information
diff --git a/libcxx/utils/generate_width_estimation_table.py b/libcxx/utils/generate_width_estimation_table.py
index f81f0ba77489e..3f41ce1657bdd 100644
--- a/libcxx/utils/generate_width_estimation_table.py
+++ b/libcxx/utils/generate_width_estimation_table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/run.py b/libcxx/utils/run.py
index 6b4d615444bcf..b97e1edf05a91 100755
--- a/libcxx/utils/run.py
+++ b/libcxx/utils/run.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/ssh.py b/libcxx/utils/ssh.py
index 77e79ce3d71fb..65041757e54ac 100755
--- a/libcxx/utils/ssh.py
+++ b/libcxx/utils/ssh.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/libcxx/utils/sym_diff.py b/libcxx/utils/sym_diff.py
index 8d2ff14c65429..c371c0b697b2a 100755
--- a/libcxx/utils/sym_diff.py
+++ b/libcxx/utils/sym_diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/lld/test/MachO/tools/generate-cfi-funcs.py b/lld/test/MachO/tools/generate-cfi-funcs.py
index 4617bd578e591..d56dceeaf7da1 100755
--- a/lld/test/MachO/tools/generate-cfi-funcs.py
+++ b/lld/test/MachO/tools/generate-cfi-funcs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Generate skeletal functions with a variety .cfi_ directives.
The purpose is to produce object-file test inputs to lld with a
diff --git a/lld/test/MachO/tools/validate-unwind-info.py b/lld/test/MachO/tools/validate-unwind-info.py
index 1cc82f8279273..b111601215477 100755
--- a/lld/test/MachO/tools/validate-unwind-info.py
+++ b/lld/test/MachO/tools/validate-unwind-info.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Validate compact unwind info by cross checking the llvm-objdump
reports of the input object file vs final linked output.
diff --git a/lld/utils/benchmark.py b/lld/utils/benchmark.py
index 7202e07ec438d..aeb9f62d2f311 100755
--- a/lld/utils/benchmark.py
+++ b/lld/utils/benchmark.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
diff --git a/lldb/docs/use/tutorials/writing-custom-commands.md b/lldb/docs/use/tutorials/writing-custom-commands.md
index d53b7e473a505..3d69bfaf6c018 100644
--- a/lldb/docs/use/tutorials/writing-custom-commands.md
+++ b/lldb/docs/use/tutorials/writing-custom-commands.md
@@ -349,7 +349,7 @@ a few of them. Here's a trivial example of adding two "utility" commands into a
"my-utilities" container:
```python3
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
diff --git a/lldb/examples/python/armv7_cortex_m_target_defintion.py b/lldb/examples/python/armv7_cortex_m_target_defintion.py
index 8225670f33e6b..6e2b699502e6f 100755
--- a/lldb/examples/python/armv7_cortex_m_target_defintion.py
+++ b/lldb/examples/python/armv7_cortex_m_target_defintion.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===-- armv7_cortex_m_target_definition.py.py ------------------*- C++ -*-===//
#
# The LLVM Compiler Infrastructure
diff --git a/lldb/examples/python/bsd.py b/lldb/examples/python/bsd.py
index 141d522b563ae..38a6ee2d35480 100755
--- a/lldb/examples/python/bsd.py
+++ b/lldb/examples/python/bsd.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import cmd
import optparse
diff --git a/lldb/examples/python/cmdtemplate.py b/lldb/examples/python/cmdtemplate.py
index be4c2da53ee06..d9be65dd698e7 100644
--- a/lldb/examples/python/cmdtemplate.py
+++ b/lldb/examples/python/cmdtemplate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ---------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/delta.py b/lldb/examples/python/delta.py
index f847b95ab119f..35f155bdea100 100755
--- a/lldb/examples/python/delta.py
+++ b/lldb/examples/python/delta.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# This module will enable GDB remote packet logging when the
diff --git a/lldb/examples/python/disasm-stress-test.py b/lldb/examples/python/disasm-stress-test.py
index 62b2b90a2860a..774787d0381cb 100755
--- a/lldb/examples/python/disasm-stress-test.py
+++ b/lldb/examples/python/disasm-stress-test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import datetime
diff --git a/lldb/examples/python/disasm.py b/lldb/examples/python/disasm.py
index df0d41584eac7..61b3f8a980bef 100755
--- a/lldb/examples/python/disasm.py
+++ b/lldb/examples/python/disasm.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/file_extract.py b/lldb/examples/python/file_extract.py
index 1a9b313b28589..4862ddec2d985 100755
--- a/lldb/examples/python/file_extract.py
+++ b/lldb/examples/python/file_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import string
import struct
diff --git a/lldb/examples/python/gdbremote.py b/lldb/examples/python/gdbremote.py
index 0bbfc1a0f1eed..2f2d82c3d3d54 100755
--- a/lldb/examples/python/gdbremote.py
+++ b/lldb/examples/python/gdbremote.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# This module will enable GDB remote packet logging when the
diff --git a/lldb/examples/python/globals.py b/lldb/examples/python/globals.py
index 1457b7612e283..3a33aef7dc26b 100755
--- a/lldb/examples/python/globals.py
+++ b/lldb/examples/python/globals.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# For the shells csh, tcsh:
diff --git a/lldb/examples/python/in_call_stack.py b/lldb/examples/python/in_call_stack.py
index c699355ce0045..c4a21b42b8d4f 100755
--- a/lldb/examples/python/in_call_stack.py
+++ b/lldb/examples/python/in_call_stack.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
def __lldb_init_module(debugger, internal_dict):
diff --git a/lldb/examples/python/lldb_module_utils.py b/lldb/examples/python/lldb_module_utils.py
index 2346ae37bec5c..c661cbdac4bf7 100644
--- a/lldb/examples/python/lldb_module_utils.py
+++ b/lldb/examples/python/lldb_module_utils.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import optparse
diff --git a/lldb/examples/python/lldbtk.py b/lldb/examples/python/lldbtk.py
index 72fe91e4e932e..d5f7b862c7f19 100644
--- a/lldb/examples/python/lldbtk.py
+++ b/lldb/examples/python/lldbtk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import shlex
diff --git a/lldb/examples/python/mach_o.py b/lldb/examples/python/mach_o.py
index 8c280689f845d..4b29328960384 100755
--- a/lldb/examples/python/mach_o.py
+++ b/lldb/examples/python/mach_o.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import cmd
import dict_utils
diff --git a/lldb/examples/python/memory.py b/lldb/examples/python/memory.py
index 985deb89d1ab9..77f6458e847a3 100755
--- a/lldb/examples/python/memory.py
+++ b/lldb/examples/python/memory.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/operating_system.py b/lldb/examples/python/operating_system.py
index f8e7abd73a09b..7bea86c7d24ba 100644
--- a/lldb/examples/python/operating_system.py
+++ b/lldb/examples/python/operating_system.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import struct
diff --git a/lldb/examples/python/performance.py b/lldb/examples/python/performance.py
index b86b5a52522e0..90b00b7c5e6d8 100755
--- a/lldb/examples/python/performance.py
+++ b/lldb/examples/python/performance.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/process_events.py b/lldb/examples/python/process_events.py
index 6225ae06b78e9..c8301b18f8d82 100755
--- a/lldb/examples/python/process_events.py
+++ b/lldb/examples/python/process_events.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/sbvalue.py b/lldb/examples/python/sbvalue.py
index fd40382817193..f9c238df74b93 100755
--- a/lldb/examples/python/sbvalue.py
+++ b/lldb/examples/python/sbvalue.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
diff --git a/lldb/examples/python/shadow.py b/lldb/examples/python/shadow.py
index 3093ebb2d6120..adb4c22ae6655 100644
--- a/lldb/examples/python/shadow.py
+++ b/lldb/examples/python/shadow.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import shlex
diff --git a/lldb/examples/python/sources.py b/lldb/examples/python/sources.py
index cea2fd03344d4..55a23bf5915ba 100644
--- a/lldb/examples/python/sources.py
+++ b/lldb/examples/python/sources.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import shlex
diff --git a/lldb/examples/python/stacks.py b/lldb/examples/python/stacks.py
index 1dc3c7acfed67..8e5ec96853052 100755
--- a/lldb/examples/python/stacks.py
+++ b/lldb/examples/python/stacks.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import optparse
import shlex
diff --git a/lldb/examples/python/symbolication.py b/lldb/examples/python/symbolication.py
index b16745ee963c9..82eab755ea390 100755
--- a/lldb/examples/python/symbolication.py
+++ b/lldb/examples/python/symbolication.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/types.py b/lldb/examples/python/types.py
index e5b4766e8c0d8..1e2fe48796b9f 100755
--- a/lldb/examples/python/types.py
+++ b/lldb/examples/python/types.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/lldb/examples/python/x86_64_linux_target_definition.py b/lldb/examples/python/x86_64_linux_target_definition.py
index 6c9aab10e9495..1ff9bc6305c49 100644
--- a/lldb/examples/python/x86_64_linux_target_definition.py
+++ b/lldb/examples/python/x86_64_linux_target_definition.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===-- x86_64_linux_target_definition.py -----------------------------*- C++ -*-===//
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/lldb/examples/python/x86_64_qemu_target_definition.py b/lldb/examples/python/x86_64_qemu_target_definition.py
index 75a8000033181..b7acdeea377e7 100644
--- a/lldb/examples/python/x86_64_qemu_target_definition.py
+++ b/lldb/examples/python/x86_64_qemu_target_definition.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===-- x86_64_qemu_target_definition.py -----------------------------*- C++ -*-===//
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/lldb/examples/python/x86_64_target_definition.py b/lldb/examples/python/x86_64_target_definition.py
index c6f2e0888e037..535171e23932a 100644
--- a/lldb/examples/python/x86_64_target_definition.py
+++ b/lldb/examples/python/x86_64_target_definition.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===-- x86_64_target_definition.py -----------------------------*- C++ -*-===//
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 8eb64b4ab8b2b..70191c44868e4 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import binascii
import json
diff --git a/lldb/scripts/analyze-project-deps.py b/lldb/scripts/analyze-project-deps.py
index 4724367e2e722..307267dea0a7d 100755
--- a/lldb/scripts/analyze-project-deps.py
+++ b/lldb/scripts/analyze-project-deps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import itertools
diff --git a/lldb/scripts/verify_api.py b/lldb/scripts/verify_api.py
index 9d14a58121bfb..2bd0360c2a3a7 100755
--- a/lldb/scripts/verify_api.py
+++ b/lldb/scripts/verify_api.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import subprocess
import optparse
diff --git a/lldb/test/API/dotest.py b/lldb/test/API/dotest.py
index 4d20c585e630e..02cacc56b9b1b 100755
--- a/lldb/test/API/dotest.py
+++ b/lldb/test/API/dotest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
if __name__ == "__main__":
import use_lldb_suite
diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/operating_system2.py b/lldb/test/API/functionalities/plugins/python_os_plugin/operating_system2.py
index 3ba68e40cb80a..1afa0b5a60695 100644
--- a/lldb/test/API/functionalities/plugins/python_os_plugin/operating_system2.py
+++ b/lldb/test/API/functionalities/plugins/python_os_plugin/operating_system2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import struct
diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/os_plugin_in_dsym/operating_system.py b/lldb/test/API/functionalities/plugins/python_os_plugin/os_plugin_in_dsym/operating_system.py
index 0f9cec670b73f..d3427810c59c8 100644
--- a/lldb/test/API/functionalities/plugins/python_os_plugin/os_plugin_in_dsym/operating_system.py
+++ b/lldb/test/API/functionalities/plugins/python_os_plugin/os_plugin_in_dsym/operating_system.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import struct
diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/operating_system.py b/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/operating_system.py
index 855cdbaf7cdc8..8acd395707592 100644
--- a/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/operating_system.py
+++ b/lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/operating_system.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import lldb
import struct
diff --git a/lldb/test/API/functionalities/postmortem/FreeBSDKernel/tools/copy-sparse.py b/lldb/test/API/functionalities/postmortem/FreeBSDKernel/tools/copy-sparse.py
index 69da526b4f804..3d75c37a5874b 100644
--- a/lldb/test/API/functionalities/postmortem/FreeBSDKernel/tools/copy-sparse.py
+++ b/lldb/test/API/functionalities/postmortem/FreeBSDKernel/tools/copy-sparse.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import re
diff --git a/lldb/test/API/test_runner/test/inferior.py b/lldb/test/API/test_runner/test/inferior.py
index 7ecadb61ae8bf..1221ba9c10c3b 100755
--- a/lldb/test/API/test_runner/test/inferior.py
+++ b/lldb/test/API/test_runner/test/inferior.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Inferior program used by process control tests."""
import argparse
diff --git a/lldb/test/API/test_runner/test/test_process_control.py b/lldb/test/API/test_runner/test/test_process_control.py
index 8a510529ddd50..01c339be93d5c 100755
--- a/lldb/test/API/test_runner/test/test_process_control.py
+++ b/lldb/test/API/test_runner/test/test_process_control.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
diff --git a/lldb/test/Shell/Quit/expect_exit_code.py b/lldb/test/Shell/Quit/expect_exit_code.py
index 436eb70406081..5537405aecd2f 100755
--- a/lldb/test/Shell/Quit/expect_exit_code.py
+++ b/lldb/test/Shell/Quit/expect_exit_code.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import subprocess
import sys
diff --git a/lldb/test/Shell/Register/Core/Inputs/strip-coredump.py b/lldb/test/Shell/Register/Core/Inputs/strip-coredump.py
index b6aeae24c29a5..f927261d77d53 100755
--- a/lldb/test/Shell/Register/Core/Inputs/strip-coredump.py
+++ b/lldb/test/Shell/Register/Core/Inputs/strip-coredump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Strip unnecessary data from a core dump to reduce its size.
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/patch-crashlog.py b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/patch-crashlog.py
index f417a090e85fe..d955ecc824533 100644
--- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/patch-crashlog.py
+++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/patch-crashlog.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import json
import os
diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index a5a7e997be044..4f66a1ca3c642 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import os
diff --git a/lldb/utils/lui/lui.py b/lldb/utils/lui/lui.py
index 27ed8f382af85..1e7781631d848 100755
--- a/lldb/utils/lui/lui.py
+++ b/lldb/utils/lui/lui.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
##===-- lui.py -----------------------------------------------*- Python -*-===##
##
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/lldb/utils/lui/sandbox.py b/lldb/utils/lui/sandbox.py
index d05c2682c9796..d3b757e2eb097 100755
--- a/lldb/utils/lui/sandbox.py
+++ b/lldb/utils/lui/sandbox.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
##===-- sandbox.py -------------------------------------------*- Python -*-===##
##
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py b/llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py
index 2e39f103cd9f3..604819ecd7061 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py
+++ b/llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py b/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py
index 7a289e868a9ce..ebe04d75704d6 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py
+++ b/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/examples/Kaleidoscope/MCJIT/complete/genk-timing.py b/llvm/examples/Kaleidoscope/MCJIT/complete/genk-timing.py
index 9045541cbe4e8..1f6f7ff5ed154 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/complete/genk-timing.py
+++ b/llvm/examples/Kaleidoscope/MCJIT/complete/genk-timing.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/examples/Kaleidoscope/MCJIT/complete/split-lib.py b/llvm/examples/Kaleidoscope/MCJIT/complete/split-lib.py
index c920e594e675a..1267540b8ad65 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/complete/split-lib.py
+++ b/llvm/examples/Kaleidoscope/MCJIT/complete/split-lib.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py b/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py
index 2e39f103cd9f3..604819ecd7061 100644
--- a/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py
+++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/test/BugPoint/compile-custom.ll.py b/llvm/test/BugPoint/compile-custom.ll.py
index 8f3e3c41d7799..42271b6752e61 100755
--- a/llvm/test/BugPoint/compile-custom.ll.py
+++ b/llvm/test/BugPoint/compile-custom.ll.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/test/Other/opt-bisect-helper.py b/llvm/test/Other/opt-bisect-helper.py
index 86c0851272e2c..efdb846a9456b 100755
--- a/llvm/test/Other/opt-bisect-helper.py
+++ b/llvm/test/Other/opt-bisect-helper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/test/TableGen/JSON-check.py b/llvm/test/TableGen/JSON-check.py
index 296a5dcfc4fdc..ea78641670483 100644
--- a/llvm/test/TableGen/JSON-check.py
+++ b/llvm/test/TableGen/JSON-check.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
import subprocess
diff --git a/llvm/tools/opt-viewer/extract-reproducers.py b/llvm/tools/opt-viewer/extract-reproducers.py
index 610439d6f4c94..b70703e0e9d7c 100644
--- a/llvm/tools/opt-viewer/extract-reproducers.py
+++ b/llvm/tools/opt-viewer/extract-reproducers.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
desc = """
A script to extract ConstraintElimination's reproducer remarks. The extracted
diff --git a/llvm/tools/opt-viewer/opt-diff.py b/llvm/tools/opt-viewer/opt-diff.py
index 2763ca4010c8a..09fa4a32ab692 100755
--- a/llvm/tools/opt-viewer/opt-diff.py
+++ b/llvm/tools/opt-viewer/opt-diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/tools/opt-viewer/opt-stats.py b/llvm/tools/opt-viewer/opt-stats.py
index 716143b31a890..3d7fed60202f6 100755
--- a/llvm/tools/opt-viewer/opt-stats.py
+++ b/llvm/tools/opt-viewer/opt-stats.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/tools/opt-viewer/opt-viewer.py b/llvm/tools/opt-viewer/opt-viewer.py
index c9c7db726f765..6fb8a8dc795f1 100755
--- a/llvm/tools/opt-viewer/opt-viewer.py
+++ b/llvm/tools/opt-viewer/opt-viewer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/tools/opt-viewer/optrecord.py b/llvm/tools/opt-viewer/optrecord.py
index 8014204a64f45..a35edac17a05f 100644
--- a/llvm/tools/opt-viewer/optrecord.py
+++ b/llvm/tools/opt-viewer/optrecord.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/utils/DSAclean.py b/llvm/utils/DSAclean.py
index 1b833ff893248..1b6ced1fd7892 100755
--- a/llvm/utils/DSAclean.py
+++ b/llvm/utils/DSAclean.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# changelog:
# 10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove
diff --git a/llvm/utils/DSAextract.py b/llvm/utils/DSAextract.py
index 96f818bd2a831..0b935e9d2a4e2 100755
--- a/llvm/utils/DSAextract.py
+++ b/llvm/utils/DSAextract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# this is a script to extract given named nodes from a dot file, with
# the associated edges. An edge is kept iff for edge x -> y
diff --git a/llvm/utils/Misc/zkill b/llvm/utils/Misc/zkill
index bc0bfd586f7a4..b2971423c6d9d 100755
--- a/llvm/utils/Misc/zkill
+++ b/llvm/utils/Misc/zkill
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import re
diff --git a/llvm/utils/Reviewing/find_interesting_reviews.py b/llvm/utils/Reviewing/find_interesting_reviews.py
index c006691079b64..e3e84a8be8cf1 100644
--- a/llvm/utils/Reviewing/find_interesting_reviews.py
+++ b/llvm/utils/Reviewing/find_interesting_reviews.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/utils/Target/ARM/analyze-match-table.py b/llvm/utils/Target/ARM/analyze-match-table.py
index c14b1a19fe39e..9864c5a0a44dc 100644
--- a/llvm/utils/Target/ARM/analyze-match-table.py
+++ b/llvm/utils/Target/ARM/analyze-match-table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/utils/abtest.py b/llvm/utils/abtest.py
index a799c8764b290..a2db15e1cbbef 100755
--- a/llvm/utils/abtest.py
+++ b/llvm/utils/abtest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Given a previous good compile narrow down miscompiles.
# Expects two directories named "before" and "after" each containing a set of
diff --git a/llvm/utils/bisect b/llvm/utils/bisect
index 9df2cd9e1136b..adc7030738a77 100755
--- a/llvm/utils/bisect
+++ b/llvm/utils/bisect
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# The way you use this is you create a script that takes in as its first
# argument a count. The script passes into LLVM the count via a command
diff --git a/llvm/utils/bugpoint_gisel_reducer.py b/llvm/utils/bugpoint_gisel_reducer.py
index 116ec792e921d..ee4f2093c59f7 100755
--- a/llvm/utils/bugpoint_gisel_reducer.py
+++ b/llvm/utils/bugpoint_gisel_reducer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Reduces GlobalISel failures.
diff --git a/llvm/utils/chunk-print-before-all.py b/llvm/utils/chunk-print-before-all.py
index 6ad126e4dff09..987c7e4bd0ede 100755
--- a/llvm/utils/chunk-print-before-all.py
+++ b/llvm/utils/chunk-print-before-all.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Given a -print-before-all and/or -print-after-all -print-module-scope log from
# an opt invocation, chunk it into a series of individual IR files, one for each
diff --git a/llvm/utils/clang-parse-diagnostics-file b/llvm/utils/clang-parse-diagnostics-file
index 1f720c34544a7..b4bd7b47bc2fb 100755
--- a/llvm/utils/clang-parse-diagnostics-file
+++ b/llvm/utils/clang-parse-diagnostics-file
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import plistlib
diff --git a/llvm/utils/convert-constraint-log-to-z3.py b/llvm/utils/convert-constraint-log-to-z3.py
index a3c33f2ef4599..d34b5915d4a6d 100755
--- a/llvm/utils/convert-constraint-log-to-z3.py
+++ b/llvm/utils/convert-constraint-log-to-z3.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Helper script to convert the log generated by '-debug-only=constraint-system'
diff --git a/llvm/utils/create_ladder_graph.py b/llvm/utils/create_ladder_graph.py
index f11aaf39bfa96..8894d35636108 100755
--- a/llvm/utils/create_ladder_graph.py
+++ b/llvm/utils/create_ladder_graph.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""A ladder graph creation program.
This is a python program that creates c source code that will generate
diff --git a/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py b/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py
index 5fa569aec540d..85bde61487c95 100755
--- a/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py
+++ b/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
""" A small program to compute checksums of LLVM checkout.
"""
from __future__ import absolute_import
diff --git a/llvm/utils/extract-section.py b/llvm/utils/extract-section.py
index bb4e252155372..cbe9ed3cfc930 100755
--- a/llvm/utils/extract-section.py
+++ b/llvm/utils/extract-section.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
"""
diff --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py
index 388723421d660..7a30c77ea93cc 100755
--- a/llvm/utils/extract_symbols.py
+++ b/llvm/utils/extract_symbols.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""A tool for extracting a list of symbols to export
diff --git a/llvm/utils/extract_vplan.py b/llvm/utils/extract_vplan.py
index cff6f5074d771..4afccf7d13572 100755
--- a/llvm/utils/extract_vplan.py
+++ b/llvm/utils/extract_vplan.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# This script extracts the VPlan digraphs from the vectoriser debug messages
# and saves them in individual dot files (one for each plan). Optionally, and
diff --git a/llvm/utils/indirect_calls.py b/llvm/utils/indirect_calls.py
index c18cffb26e7ae..03299270afca4 100755
--- a/llvm/utils/indirect_calls.py
+++ b/llvm/utils/indirect_calls.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""A tool for looking for indirect jumps and calls in x86 binaries.
diff --git a/llvm/utils/lint/common_lint.py b/llvm/utils/lint/common_lint.py
index 07b8fc5899e55..14fd7b790c41e 100644
--- a/llvm/utils/lint/common_lint.py
+++ b/llvm/utils/lint/common_lint.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Common lint functions applicable to multiple types of files.
diff --git a/llvm/utils/lint/cpp_lint.py b/llvm/utils/lint/cpp_lint.py
index 3734ba456626f..646cd8eae12dd 100755
--- a/llvm/utils/lint/cpp_lint.py
+++ b/llvm/utils/lint/cpp_lint.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Checks C++ files to make sure they conform to LLVM standards, as specified in
# http://llvm.org/docs/CodingStandards.html .
diff --git a/llvm/utils/lint/generic_lint.py b/llvm/utils/lint/generic_lint.py
index 18e6e67e29a6e..130c952b24bd6 100755
--- a/llvm/utils/lint/generic_lint.py
+++ b/llvm/utils/lint/generic_lint.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Checks files to make sure they conform to LLVM standards which can be applied
# to any programming language: at present, line length and trailing whitespace.
diff --git a/llvm/utils/lit/lit/ProgressBar.py b/llvm/utils/lit/lit/ProgressBar.py
index 382b8f2e52540..692d5100e1572 100644
--- a/llvm/utils/lit/lit/ProgressBar.py
+++ b/llvm/utils/lit/lit/ProgressBar.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Source: http://code.activestate.com/recipes/475116/, with
# modifications by Daniel Dunbar.
diff --git a/llvm/utils/lit/tests/Inputs/check_path.py b/llvm/utils/lit/tests/Inputs/check_path.py
index 62c906846fbb5..dfca004d50758 100644
--- a/llvm/utils/lit/tests/Inputs/check_path.py
+++ b/llvm/utils/lit/tests/Inputs/check_path.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/utils/lit/tests/Inputs/fake-externals/cd b/llvm/utils/lit/tests/Inputs/fake-externals/cd
index 9d9612dca4d2e..ab05763f44c82 100755
--- a/llvm/utils/lit/tests/Inputs/fake-externals/cd
+++ b/llvm/utils/lit/tests/Inputs/fake-externals/cd
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fake_external
diff --git a/llvm/utils/lit/tests/Inputs/fake-externals/diff b/llvm/utils/lit/tests/Inputs/fake-externals/diff
index 9d9612dca4d2e..ab05763f44c82 100755
--- a/llvm/utils/lit/tests/Inputs/fake-externals/diff
+++ b/llvm/utils/lit/tests/Inputs/fake-externals/diff
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fake_external
diff --git a/llvm/utils/lit/tests/Inputs/fake-externals/env b/llvm/utils/lit/tests/Inputs/fake-externals/env
index 9d9612dca4d2e..ab05763f44c82 100755
--- a/llvm/utils/lit/tests/Inputs/fake-externals/env
+++ b/llvm/utils/lit/tests/Inputs/fake-externals/env
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fake_external
diff --git a/llvm/utils/lit/tests/Inputs/fake-externals/export b/llvm/utils/lit/tests/Inputs/fake-externals/export
index 9d9612dca4d2e..ab05763f44c82 100755
--- a/llvm/utils/lit/tests/Inputs/fake-externals/export
+++ b/llvm/utils/lit/tests/Inputs/fake-externals/export
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fake_external
diff --git a/llvm/utils/lit/tests/Inputs/fake-externals/mkdir b/llvm/utils/lit/tests/Inputs/fake-externals/mkdir
index 9d9612dca4d2e..ab05763f44c82 100755
--- a/llvm/utils/lit/tests/Inputs/fake-externals/mkdir
+++ b/llvm/utils/lit/tests/Inputs/fake-externals/mkdir
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fake_external
diff --git a/llvm/utils/lit/tests/Inputs/fake-externals/rm b/llvm/utils/lit/tests/Inputs/fake-externals/rm
index 9d9612dca4d2e..ab05763f44c82 100755
--- a/llvm/utils/lit/tests/Inputs/fake-externals/rm
+++ b/llvm/utils/lit/tests/Inputs/fake-externals/rm
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import fake_external
diff --git a/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py
index f8fe95cbfbb30..4573cbd136aaa 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-detect-duplicate/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-detect-duplicate/DummySubDir/OneTest.py
index bd48ccc6d63a6..7404103d54fc3 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-detect-duplicate/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-detect-duplicate/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-discovery-failed/subdir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-discovery-failed/subdir/OneTest.py
index 4816459dee45a..c430bc99e5548 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-discovery-failed/subdir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-discovery-failed/subdir/OneTest.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
raise SystemExit("We are not a valid gtest executable!")
diff --git a/llvm/utils/lit/tests/Inputs/googletest-format-respect-gtest-sharding-env-vars/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-format-respect-gtest-sharding-env-vars/DummySubDir/OneTest.py
index 0aa5d0ba39cbf..411a93e5f756f 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-format-respect-gtest-sharding-env-vars/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-format-respect-gtest-sharding-env-vars/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
index c45a710d52dae..21b38ef219999 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-no-sharding/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-no-sharding/DummySubDir/OneTest.py
index 38d76cd637fb5..140da7558065a 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-no-sharding/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-no-sharding/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-prefix/DummySubDir/test_one.py b/llvm/utils/lit/tests/Inputs/googletest-prefix/DummySubDir/test_one.py
index 0aa5d0ba39cbf..411a93e5f756f 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-prefix/DummySubDir/test_one.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-prefix/DummySubDir/test_one.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-sanitizer-error/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-sanitizer-error/DummySubDir/OneTest.py
index 0811149b1110c..55906c9cf468b 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-sanitizer-error/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-sanitizer-error/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py
index d1698c69f4d12..53d8c41924b95 100644
--- a/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py
+++ b/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py b/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py
index a5a2bc9da8af7..b6c85833684ee 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-control-chars.py b/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-control-chars.py
index 34f08a03de0e7..05febc5413915 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-control-chars.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-control-chars.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-not/fail.py b/llvm/utils/lit/tests/Inputs/shtest-not/fail.py
index d64b8cb0f895a..a01abefad1124 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-not/fail.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-not/fail.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import print_environment
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-not/fail2.py b/llvm/utils/lit/tests/Inputs/shtest-not/fail2.py
index e9fb0bc0f91e0..e57f190cce572 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-not/fail2.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-not/fail2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import print_environment
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-not/pass.py b/llvm/utils/lit/tests/Inputs/shtest-not/pass.py
index bd113596b7db0..9d5f8bf69ff42 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-not/pass.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-not/pass.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import print_environment
diff --git a/llvm/utils/lit/tests/Inputs/shtest-output-printing/write-a-lot.py b/llvm/utils/lit/tests/Inputs/shtest-output-printing/write-a-lot.py
index 5dbb94a41cbfd..5d3926a397425 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-output-printing/write-a-lot.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-output-printing/write-a-lot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/check_args.py b/llvm/utils/lit/tests/Inputs/shtest-shell/check_args.py
index 2ad14c4017eab..6c5a841d9196c 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/check_args.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/check_args.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse
import platform
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
index 9463251d823ab..f5e78b157a5d4 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
index 357089d4899b5..56919479c79ac 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
diff --git a/llvm/utils/llvm-gisel-cov.py b/llvm/utils/llvm-gisel-cov.py
index 9d9526e0558a5..e55f7a03f3831 100755
--- a/llvm/utils/llvm-gisel-cov.py
+++ b/llvm/utils/llvm-gisel-cov.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Summarize the information in the given coverage files.
diff --git a/llvm/utils/llvm-original-di-preservation.py b/llvm/utils/llvm-original-di-preservation.py
index cdca2ec8153b8..af79a553efa8b 100755
--- a/llvm/utils/llvm-original-di-preservation.py
+++ b/llvm/utils/llvm-original-di-preservation.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Debugify summary for the original debug info testing.
#
diff --git a/llvm/utils/merge-json.py b/llvm/utils/merge-json.py
index f5b9dcf11c4cd..23db551b16666 100644
--- a/llvm/utils/merge-json.py
+++ b/llvm/utils/merge-json.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""A command line utility to merge two JSON files.
This is a python program that merges two JSON files into a single one. The
diff --git a/llvm/utils/prepare-code-coverage-artifact.py b/llvm/utils/prepare-code-coverage-artifact.py
index b865211088c8e..8e9a5b3b8ff3c 100755
--- a/llvm/utils/prepare-code-coverage-artifact.py
+++ b/llvm/utils/prepare-code-coverage-artifact.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/llvm/utils/release/findRegressions-nightly.py b/llvm/utils/release/findRegressions-nightly.py
index 1fcc54d33deb6..99d872631a6b1 100755
--- a/llvm/utils/release/findRegressions-nightly.py
+++ b/llvm/utils/release/findRegressions-nightly.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
import re, string, sys, os, time
diff --git a/llvm/utils/release/findRegressions-simple.py b/llvm/utils/release/findRegressions-simple.py
index 81fbfa980a3a6..6e855ef835363 100755
--- a/llvm/utils/release/findRegressions-simple.py
+++ b/llvm/utils/release/findRegressions-simple.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
import re, string, sys, os, time, math
diff --git a/llvm/utils/remote-exec.py b/llvm/utils/remote-exec.py
index 4d646c5d3e282..9c586e7e7ef3e 100644
--- a/llvm/utils/remote-exec.py
+++ b/llvm/utils/remote-exec.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
diff --git a/llvm/utils/schedcover.py b/llvm/utils/schedcover.py
index caa73b6d6a747..04b2f6a23182b 100755
--- a/llvm/utils/schedcover.py
+++ b/llvm/utils/schedcover.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# This creates a CSV file from the output of the debug output of subtarget:
# llvm-tblgen --gen-subtarget --debug-only=subtarget-emitter
diff --git a/llvm/utils/shuffle_fuzz.py b/llvm/utils/shuffle_fuzz.py
index c03c77ce092a6..f3619edf3108b 100755
--- a/llvm/utils/shuffle_fuzz.py
+++ b/llvm/utils/shuffle_fuzz.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""A shuffle vector fuzz tester.
diff --git a/llvm/utils/shuffle_select_fuzz_tester.py b/llvm/utils/shuffle_select_fuzz_tester.py
index f51945b530d3f..192a607d50bf0 100755
--- a/llvm/utils/shuffle_select_fuzz_tester.py
+++ b/llvm/utils/shuffle_select_fuzz_tester.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""A shuffle-select vector fuzz tester.
diff --git a/llvm/utils/sort_includes.py b/llvm/utils/sort_includes.py
index d30efd0b438d1..d62d2c965dc60 100755
--- a/llvm/utils/sort_includes.py
+++ b/llvm/utils/sort_includes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""Script to sort the top-most block of #include lines.
diff --git a/llvm/utils/testgen/mc-bundling-x86-gen.py b/llvm/utils/testgen/mc-bundling-x86-gen.py
index a75f94bec814f..283a26a9997d6 100644
--- a/llvm/utils/testgen/mc-bundling-x86-gen.py
+++ b/llvm/utils/testgen/mc-bundling-x86-gen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Auto-generates an exhaustive and repetitive test for correct bundle-locked
# alignment on x86.
diff --git a/llvm/utils/unicode-case-fold.py b/llvm/utils/unicode-case-fold.py
index 9639aa0dc44b4..831e422364027 100755
--- a/llvm/utils/unicode-case-fold.py
+++ b/llvm/utils/unicode-case-fold.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
Unicode case folding database conversion utility
diff --git a/llvm/utils/wciia.py b/llvm/utils/wciia.py
index 7240d3c2a9ff2..3391576fa3cdf 100755
--- a/llvm/utils/wciia.py
+++ b/llvm/utils/wciia.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
wciia - Whose Code Is It Anyway
diff --git a/mlir/utils/lldb-scripts/action_debugging.py b/mlir/utils/lldb-scripts/action_debugging.py
index 2371967bf72a4..9eba576944f90 100644
--- a/mlir/utils/lldb-scripts/action_debugging.py
+++ b/mlir/utils/lldb-scripts/action_debugging.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# ---------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
diff --git a/openmp/runtime/tools/summarizeStats.py b/openmp/runtime/tools/summarizeStats.py
index c1a59288fae7f..d426f75a9fea7 100644
--- a/openmp/runtime/tools/summarizeStats.py
+++ b/openmp/runtime/tools/summarizeStats.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import pandas as pd
diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/genctest.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/genctest.py
index ed0e6c6a00727..f2d664a9d0770 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/genctest.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/genctest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
import gmpapi
from gmpapi import void
diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/gendata.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/gendata.py
index 3ca17ff359d91..bf9644c0d1900 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/gendata.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/gendata.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import random
import gmpapi
diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py
index 1b5a38ce829b3..06a2e5a593729 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/genpytest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import gmpapi
import sys
diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/gmpapi.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/gmpapi.py
index d3eeeba288384..00641d12ff02a 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/gmpapi.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/gmpapi.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import sys
diff --git a/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py b/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
index 3677acb480573..3cf2c31d645f7 100644
--- a/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
+++ b/polly/lib/External/isl/imath/tests/gmp-compat-test/runtest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
diff --git a/polly/lib/External/isl/imath/tools/findthreshold.py b/polly/lib/External/isl/imath/tools/findthreshold.py
index fbb325e1da916..15637c855fa8b 100644
--- a/polly/lib/External/isl/imath/tools/findthreshold.py
+++ b/polly/lib/External/isl/imath/tools/findthreshold.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
## Name: findthreshold.py
## Purpose: Find a good threshold for recursive multiplication.
diff --git a/polly/lib/External/isl/imath/tools/mkdoc.py b/polly/lib/External/isl/imath/tools/mkdoc.py
index 34432dd28a2d8..5fb0b287f1f51 100644
--- a/polly/lib/External/isl/imath/tools/mkdoc.py
+++ b/polly/lib/External/isl/imath/tools/mkdoc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
##
## Name: mkdoc.py
## Purpose: Extract documentation from header files.
diff --git a/polly/utils/jscop2cloog.py b/polly/utils/jscop2cloog.py
index 29383974f2678..ccd05c6c7fdff 100755
--- a/polly/utils/jscop2cloog.py
+++ b/polly/utils/jscop2cloog.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse, os
import json
diff --git a/polly/utils/pyscop/jscop2iscc.py b/polly/utils/pyscop/jscop2iscc.py
index 42f4cc180f1fb..13dda4d542d33 100755
--- a/polly/utils/pyscop/jscop2iscc.py
+++ b/polly/utils/pyscop/jscop2iscc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import argparse, isl, os
import json
More information about the libcxx-commits
mailing list