Skip to content

[NFC] Remove Python 2 imports from __future__ #42086

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

Merged
merged 1 commit into from
Apr 13, 2022
Merged
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
4 changes: 1 addition & 3 deletions benchmark/scripts/build_script_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python

from __future__ import print_function
#!/usr/bin/env python3

import argparse
import os
Expand Down
4 changes: 1 addition & 3 deletions 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 Expand Up @@ -27,8 +27,6 @@ class `ReportFormatter` creates the test comparison report in specified format.

"""

from __future__ import print_function

import argparse
import functools
import re
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
4 changes: 1 addition & 3 deletions 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 All @@ -14,8 +14,6 @@

# Generate boilerplate, CMakeLists.txt and utils/main.swift from templates.

from __future__ import print_function

import argparse
import os
import subprocess
Expand Down
4 changes: 1 addition & 3 deletions 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 All @@ -12,8 +12,6 @@
#
# ===---------------------------------------------------------------------===//

from __future__ import print_function

import functools
import glob
import multiprocessing
Expand Down
4 changes: 1 addition & 3 deletions 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 All @@ -21,8 +21,6 @@
#
# ===---------------------------------------------------------------------===//

from __future__ import print_function

import argparse
import glob
import os
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
4 changes: 1 addition & 3 deletions 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 Expand Up @@ -57,8 +57,6 @@
# ]
# }

from __future__ import print_function

import json
import re
import sys
Expand Down
4 changes: 1 addition & 3 deletions docs/scripts/ns-html2rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function

#!/usr/bin/env python3
import re
import subprocess
import sys
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/FloatingPointTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import SwiftShims

%{
from __future__ import division
from SwiftIntTypes import all_integer_types
from SwiftFloatingPointTypes import all_floating_point_types

Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/IntegerTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# Utility code for later in this template
#

from __future__ import division
from SwiftIntTypes import all_integer_types, int_max_bits, should_define_truncating_bit_pattern_init
from SwiftFloatingPointTypes import getFtoIBounds

Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/SIMDConcreteOperations.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//

%{
from __future__ import division
from SwiftIntTypes import all_integer_types
word_bits = int(CMAKE_SIZEOF_VOID_P) * 8
storagescalarCounts = [2,4,8,16,32,64]
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/SIMDVectorTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//===----------------------------------------------------------------------===//

%{
from __future__ import division
from SwiftIntTypes import all_integer_types
word_bits = int(CMAKE_SIZEOF_VOID_P) * 8
storagescalarCounts = [2,4,8,16,32,64]
Expand Down
4 changes: 1 addition & 3 deletions test/CrossImport/Inputs/rewrite-module-triples.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/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.
"""

from __future__ import print_function

import os
import platform
import shutil
Expand Down
4 changes: 1 addition & 3 deletions test/Driver/Dependencies/Inputs/fake-build-for-bitcode.py
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 All @@ -16,8 +16,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import os
import sys

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 All @@ -15,8 +15,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import os
import sys

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 All @@ -16,8 +16,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import os
import sys

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 All @@ -17,8 +17,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import os
import shutil
import signal
Expand Down
4 changes: 1 addition & 3 deletions 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 Expand Up @@ -27,8 +27,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import os
import shutil
import subprocess
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
4 changes: 1 addition & 3 deletions 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 All @@ -11,6 +11,4 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

print("Sorry, I'm lazy-clang")
4 changes: 1 addition & 3 deletions 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 All @@ -11,6 +11,4 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

print("Sorry, wrong number!")
4 changes: 1 addition & 3 deletions 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 All @@ -11,8 +11,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import os
import sys

Expand Down
4 changes: 1 addition & 3 deletions 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 All @@ -11,8 +11,6 @@
#
# ----------------------------------------------------------------------------

from __future__ import print_function

import sys

filelistFile = sys.argv[sys.argv.index('-filelist') + 1]
Expand Down
4 changes: 1 addition & 3 deletions test/Incremental/Verifier/gen-output-file-map.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python

from __future__ import print_function
#!/usr/bin/env python3

import argparse
import io
Expand Down
4 changes: 1 addition & 3 deletions test/Inputs/getmtime.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python

from __future__ import print_function
#!/usr/bin/env python3

import os
import sys
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
Loading