[libcxx-commits] [libcxx] [libcxx] Unify python shebangs (PR #187258)

Ross Burton via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 18 05:38:23 PDT 2026


https://github.com/rossburton created https://github.com/llvm/llvm-project/pull/187258

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/

>From 7f975798d13d0ca564e18476ac72e127bb33c34a 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] [libcxx] 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/
---
 libcxx/test/libcxx-03/transitive_includes/to_csv.py      | 2 +-
 libcxx/test/libcxx/transitive_includes/to_csv.py         | 2 +-
 libcxx/utils/ci/lnt/commit-watch                         | 2 +-
 libcxx/utils/ci/lnt/run-benchmarks                       | 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 +-
 15 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/libcxx/test/libcxx-03/transitive_includes/to_csv.py b/libcxx/test/libcxx-03/transitive_includes/to_csv.py
index 3035ff6cfe5c8..b98bb5aa699dd 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 3035ff6cfe5c8..b98bb5aa699dd 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/ci/lnt/commit-watch b/libcxx/utils/ci/lnt/commit-watch
index 19aa76cb191fe..6aec4712d4036 100755
--- a/libcxx/utils/ci/lnt/commit-watch
+++ b/libcxx/utils/ci/lnt/commit-watch
@@ -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/ci/lnt/run-benchmarks b/libcxx/utils/ci/lnt/run-benchmarks
index 256871b6a8576..bd6896fe30cb6 100755
--- a/libcxx/utils/ci/lnt/run-benchmarks
+++ b/libcxx/utils/ci/lnt/run-benchmarks
@@ -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 c64a5a00c4c16..83b86fa9c130c 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 9d2e095ab9ff7..13f40c7caa301 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 774a510849176..7d01dc390968d 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 618612c613741..720a704ffba9b 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.



More information about the libcxx-commits mailing list