Skip to content

Commit 893f9bf

Browse files
committed
[NFC] Remove Python 2 imports from __future__
The `__future__` we relied on is now, where the 3 specific things are all included [since Python 3.0](https://docs.python.org/3/library/__future__.html): * absolute_import * print_function * unicode_literals These import statements are no-ops and are no longer necessary.
1 parent 3e739f6 commit 893f9bf

File tree

74 files changed

+0
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+0
-149
lines changed

benchmark/scripts/build_script_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import os
75
import shutil

benchmark/scripts/compare_perf_tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class `ReportFormatter` creates the test comparison report in specified format.
2727
2828
"""
2929

30-
from __future__ import print_function
31-
3230
import argparse
3331
import functools
3432
import re

benchmark/scripts/generate_harness/generate_harness.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

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

17-
from __future__ import print_function
18-
1917
import argparse
2018
import os
2119
import subprocess

benchmark/scripts/perf_test_driver/perf_test_driver.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#
1313
# ===---------------------------------------------------------------------===//
1414

15-
from __future__ import print_function
16-
1715
import functools
1816
import glob
1917
import multiprocessing

benchmark/scripts/run_smoke_bench

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#
2222
# ===---------------------------------------------------------------------===//
2323

24-
from __future__ import print_function
25-
2624
import argparse
2725
import glob
2826
import os

benchmark/utils/convertToJSON.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
# ]
5858
# }
5959

60-
from __future__ import print_function
61-
6260
import json
6361
import re
6462
import sys

docs/scripts/ns-html2rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/usr/bin/env python
2-
from __future__ import print_function
3-
42
import re
53
import subprocess
64
import sys

test/CrossImport/Inputs/rewrite-module-triples.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
the indicated module triples instead.
55
"""
66

7-
from __future__ import print_function
8-
97
import os
108
import platform
119
import shutil

test/Driver/Dependencies/Inputs/fake-build-for-bitcode.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#
1717
# ----------------------------------------------------------------------------
1818

19-
from __future__ import print_function
20-
2119
import os
2220
import sys
2321

test/Driver/Dependencies/Inputs/fake-build-whole-module.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#
1616
# ----------------------------------------------------------------------------
1717

18-
from __future__ import print_function
19-
2018
import os
2119
import sys
2220

test/Driver/Dependencies/Inputs/modify-non-primary-files.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#
1717
# ----------------------------------------------------------------------------
1818

19-
from __future__ import print_function
20-
2119
import os
2220
import sys
2321

test/Driver/Dependencies/Inputs/update-dependencies-bad.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#
1818
# ----------------------------------------------------------------------------
1919

20-
from __future__ import print_function
21-
2220
import os
2321
import shutil
2422
import signal

test/Driver/Dependencies/Inputs/update-dependencies.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#
2828
# ----------------------------------------------------------------------------
2929

30-
from __future__ import print_function
31-
3230
import os
3331
import shutil
3432
import subprocess

test/Driver/Inputs/fake-toolchain/clang

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@
1111
#
1212
# ----------------------------------------------------------------------------
1313

14-
from __future__ import print_function
15-
1614
print("Sorry, I'm lazy-clang")

test/Driver/Inputs/fake-toolchain/ld

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@
1111
#
1212
# ----------------------------------------------------------------------------
1313

14-
from __future__ import print_function
15-
1614
print("Sorry, wrong number!")

test/Driver/Inputs/filelists/check-filelist-abc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#
1212
# ----------------------------------------------------------------------------
1313

14-
from __future__ import print_function
15-
1614
import os
1715
import sys
1816

test/Driver/Inputs/filelists/fake-ld.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#
1212
# ----------------------------------------------------------------------------
1313

14-
from __future__ import print_function
15-
1614
import sys
1715

1816
filelistFile = sys.argv[sys.argv.index('-filelist') + 1]

test/Incremental/Verifier/gen-output-file-map.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import io
75
import json

test/Inputs/getmtime.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import os
64
import sys
75

test/RemoteMirror/Inputs/interop.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#
88
# Invoke by passing the various Swift build directories as parameters.
99

10-
from __future__ import print_function
11-
1210
import itertools
1311
import os
1412
import subprocess

test/attr/Inputs/access-note-gen.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
the originals in the process.
77
"""
88

9-
from __future__ import print_function
10-
119
import io
1210
import re
1311
import sys

tools/swift-inspect/build_script_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import os
75
import subprocess

utils/80+-check

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python
22

33

4-
from __future__ import print_function, unicode_literals
5-
64
import argparse
75
import sys
86

utils/PathSanitizingFileCheck

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
# See https://swift.org/LICENSE.txt for license information
1010
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111

12-
from __future__ import print_function
13-
1412
import argparse
1513
import io
1614
import re

utils/android/adb/commands.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#
1616
# ----------------------------------------------------------------------------
1717

18-
from __future__ import print_function
19-
2018
import os
2119
import subprocess
2220
import tempfile

utils/android/adb_push_built_products/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#
1616
# ----------------------------------------------------------------------------
1717

18-
from __future__ import print_function
19-
2018
import argparse
2119
import glob
2220
import os

utils/android/adb_test_runner/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#
1818
# ----------------------------------------------------------------------------
1919

20-
from __future__ import print_function
21-
2220
import os
2321
import sys
2422

utils/api_checker/sdk-module-lists/infer-imports.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python -u
22

3-
from __future__ import print_function
4-
53
import os
64
import sys
75

utils/api_checker/swift-api-checker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python3
22

3-
from __future__ import print_function
4-
53
import argparse
64
import os
75
import subprocess

utils/apply-fixit-edits.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
# See https://swift.org/LICENSE.txt for license information
1010
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111

12-
from __future__ import print_function
13-
1412
import argparse
1513
import collections
1614
import json

utils/bug_reducer/bug_reducer/func_bug_reducer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import md5
42
import os
53
import sys

utils/bug_reducer/bug_reducer/list_reducer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import random
42

53
TESTRESULT_NOFAILURE = "NoFailure"

utils/bug_reducer/bug_reducer/opt_bug_reducer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import json
42
import md5
53
import subprocess

utils/bug_reducer/bug_reducer/random_bug_finder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import json
42
import random
53
import subprocess

utils/bug_reducer/bug_reducer/swift_tools.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import os
42
import subprocess
53

utils/build-tooling-libs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
# This utility also provides capability to gather profile data and build the parser
2424
# library with PGO optimization enabled.
2525

26-
from __future__ import print_function
27-
2826
import copy
2927
import multiprocessing
3028
import os

utils/build_swift/build_swift/constants.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
# See https://swift.org/LICENSE.txt for license information
77
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88

9-
10-
from __future__ import absolute_import
11-
from __future__ import print_function
12-
from __future__ import unicode_literals
13-
149
import os.path
1510

1611

utils/chex.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# strings matching the regex /< (i[0-9]+) \s+ (0x[0-9A-Fa-f]+) >/x with the
55
# decimal literal equivalent that would really appear in printed LLVM IR.
66

7-
from __future__ import print_function
8-
97
import re
108
import sys
119

utils/cmpcodesize/cmpcodesize/compare.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
# See https://swift.org/LICENSE.txt for license information
99
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010

11-
from __future__ import print_function
12-
1311
import collections
1412
import os
1513
import re

utils/cmpcodesize/cmpcodesize/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
# See https://swift.org/LICENSE.txt for license information
1010
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111

12-
from __future__ import print_function
13-
1412
import argparse
1513
import collections
1614
import csv

utils/coverage/coverage-touch-tests

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
# See https://swift.org/LICENSE.txt for license information
1010
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111

12-
from __future__ import print_function
13-
1412
import argparse
1513
import logging
1614
import multiprocessing

utils/dev-scripts/blockifyasm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#
2323
# ----------------------------------------------------------------------------
2424

25-
from __future__ import print_function
26-
2725
import re
2826
import sys
2927
from collections import defaultdict

utils/dev-scripts/split-cmdline

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
#
3737
# ----------------------------------------------------------------------------
3838

39-
from __future__ import print_function
40-
4139
import os
4240
import re
4341
import shlex

utils/gyb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# GYB: Generate Your Boilerplate (improved names welcome; at least
33
# this one's short). See -h output for instructions
44

5-
from __future__ import print_function
6-
75
import io
86
import os
97
import re

utils/gyb_syntax_support/Node.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
import sys # noqa: I201
32

43
from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word

utils/incrparse/incr_transfer_round_trip.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import os
75
import subprocess

utils/incrparse/test_util.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

3-
from __future__ import print_function
4-
53
import argparse
64
import io
75
import os

0 commit comments

Comments
 (0)