Skip to content

Change env python to env python3 #41981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_DTrace.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- Benchmark_DTrace.in ---------------------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_Driver
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ===--- Benchmark_Driver ------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_GuardMalloc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- Benchmark_GuardMalloc.in ----------------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_QuickCheck.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- Benchmark_QuickCheck.in -----------------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/Benchmark_RuntimeLeaksRunner.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- Benchmark_RuntimeLeaksRunner.in ---------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/build_linux.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse
import os
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/build_script_helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should drop __future__

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is intended as just dropping all the shebangs and not doing any compatibility cleanups, just making it easy to test if anything breaks with Python 3 (since all the __future__ etc. should keep working)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably shouldn't be merged at all


Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/compare_perf_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ===--- compare_perf_tests.py -------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/create_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse
import os
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/generate_harness/generate_harness.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- generate_harness.py ---------------------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/perf_test_driver/perf_test_driver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- perf_test_driver.py ---------------------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/run_smoke_bench
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ===--- run_smoke_bench -------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/test_Benchmark_Driver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ===--- test_Benchmark_Driver.py ----------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/test_compare_perf_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ===--- test_compare_perf_tests.py --------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion benchmark/scripts/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ===--- test_utils.py ---------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion benchmark/utils/convertToJSON.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# ===--- convertToJSON.py ------------------------------------------------===//
#
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/ns-html2rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function

import re
Expand Down
2 changes: 1 addition & 1 deletion test/CrossImport/Inputs/rewrite-module-triples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""
Renames files or directories with "module-triple-here" in their names to use
the indicated module triples instead.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# fake-build-for-bitcode.py - Fake build with -embed-bitcode -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# fake-build-for-whole-module.py - Optimized fake build -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# modify-non-primary-files.py - Fake build while modifying files -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Dependencies/Inputs/touch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# touch.py - /bin/touch that writes the LLVM epoch -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# update-dependencies-bad.py - Fails on bad.swift -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Dependencies/Inputs/update-dependencies.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# update-dependencies.py - Fake build for dependency analysis -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/crash-after-generating-pch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# crash.py - Sends SIGKILL to self. -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/crash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# crash.py - Sends SIGKILL to self. -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/fail.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# fail.py - Just exits with an error code -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/fake-toolchain/clang
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# clang++ - Fake Clang to test finding clang++ in the toolchain path
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/fake-toolchain/ld
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# ld - Fake ld to test finding the Darwin linker in the toolchain path
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/filelists/check-filelist-abc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# check-filelist-abc.py - Fake build to test driver-produced -filelists.
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Driver/Inputs/filelists/fake-ld.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# fake-ld.py - Fake Darwin linker to test driver-produced -filelists.
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/Incremental/Verifier/gen-output-file-map.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion test/Inputs/getmtime.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion test/Inputs/symlink.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion test/Inputs/timeout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/uar/bin/env python
#!/uar/bin/env python3

import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion test/Misc/you-should-be-using-LLVM_DEBUG.test-sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- python -*-
# RUN: %{python} %s '%swift_src_root'

Expand Down
2 changes: 1 addition & 1 deletion test/ModuleInterface/ModuleCache/Inputs/check-is-new.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# check-is-new.py - a more-legible way to read a timestamp test than test(1)
#
Expand Down
2 changes: 1 addition & 1 deletion test/ModuleInterface/ModuleCache/Inputs/check-is-old.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# check-is-old.py - a more-legible way to read a timestamp test than test(1)
#
Expand Down
2 changes: 1 addition & 1 deletion test/ModuleInterface/ModuleCache/Inputs/make-old.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# make-old.py - /bin/touch that writes a constant "old" timestamp.
#
Expand Down
2 changes: 1 addition & 1 deletion test/RemoteMirror/Inputs/interop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Exercise the SwiftRemoteMirrorLegacyInterop API. This works with
# multiple versions of Swift. It builds Swift code using all versions,
Expand Down
2 changes: 1 addition & 1 deletion test/ScanDependencies/Inputs/CommandRunner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import subprocess
import sys
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/Inputs/binary_sub.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys

Expand Down
2 changes: 1 addition & 1 deletion test/SourceKit/Inputs/sourcekitd_path_sanitize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# sourcekitd_path_sanitize.py - Cleans up paths from sourcekitd-test output
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion test/attr/Inputs/access-note-gen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# coding=utf8

"""
Expand Down
2 changes: 1 addition & 1 deletion tools/swift-inspect/build_script_helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion utils/80+-check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3


from __future__ import print_function, unicode_literals
Expand Down
2 changes: 1 addition & 1 deletion utils/PathSanitizingFileCheck
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# utils/PathSanitizingFileCheck -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/analyze_code_size.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse
import re
Expand Down
2 changes: 1 addition & 1 deletion utils/android/adb_clean.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# adb_reboot.py - Reboots and cleans an Android device. -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/android/adb_push_built_products.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# adb_push_build_products.py - Push libraries to Android device -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/android/adb_test_runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# adb_test_runner.py - Calls adb_test_runner.main -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/apply-fixit-edits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# utils/apply-fixit-edits.py - Apply edits from .remap files -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/backtrace-check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3


"""
Expand Down
2 changes: 1 addition & 1 deletion utils/bug_reducer/bug_reducer/bug_reducer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse

Expand Down
2 changes: 1 addition & 1 deletion utils/build-script
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# This source file is part of the Swift.org open source project
#
Expand Down
1 change: 0 additions & 1 deletion utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ function set_build_options_for_host() {
watchos-* | \
watchsimulator-*)
swift_cmake_options+=(
-DPython2_EXECUTABLE="$(xcrun -f python2.7)"
-DPython3_EXECUTABLE="$(xcrun -f python3)"
)
case ${host} in
Expand Down
2 changes: 1 addition & 1 deletion utils/build-tooling-libs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# utils/build-tooling-libs - Helper tool for building the SwiftSyntax paresr
# and SwiftStaticMirror libraries -*- python -*-
#
Expand Down
2 changes: 1 addition & 1 deletion utils/build_swift/run_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# This source file is part of the Swift.org open source project
#
Expand Down
2 changes: 1 addition & 1 deletion utils/check_freestanding_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# This source file is part of the Swift.org open source project
#
Expand Down
2 changes: 1 addition & 1 deletion utils/check_freestanding_size.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# This source file is part of the Swift.org open source project
#
Expand Down
2 changes: 1 addition & 1 deletion utils/chex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Check HEX -- a stupid filter that allows hexadecimal literals to be checked
# for in LLVM IR FileCheck tests. It works by replacing occurrences of
# strings matching the regex /< (i[0-9]+) \s+ (0x[0-9A-Fa-f]+) >/x with the
Expand Down
2 changes: 1 addition & 1 deletion utils/cmpcodesize/cmpcodesize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# cmpcodesize.py - Compare sizes of built products -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/cmpcodesize/cmpcodesize/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# cmpcodesize/main.py - Command-line entry point for cmpcodesize -*- python -*-
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/coverage/coverage-build-db
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# utils/coverage/coverage-build-db - Build sqlite3 database from profdata
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/coverage/coverage-generate-data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# utils/coverage/coverage-generate-data - Generate, parse test run profdata
#
# This source file is part of the Swift.org open source project
Expand Down
2 changes: 1 addition & 1 deletion utils/coverage/coverage-query-db
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# utils/coverage/coverage-query-db - Find covering tests using coverage
# database
#
Expand Down
Loading