Skip to content

Commit 974b9f1

Browse files
authored
Merge pull request #40144 from jorng/build-script_py3
build-swift: Explicitly use python3
2 parents 8a7ca32 + 8e9e11c commit 974b9f1

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

utils/build-script

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
# This source file is part of the Swift.org open source project
44
#
@@ -8,14 +8,10 @@
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-
1211
"""
1312
The ultimate tool for building Swift.
1413
"""
1514

16-
17-
from __future__ import absolute_import, print_function, unicode_literals
18-
1915
import json
2016
import os
2117
import platform
@@ -32,8 +28,6 @@ from build_swift.build_swift.constants import SWIFT_BUILD_ROOT
3228
from build_swift.build_swift.constants import SWIFT_REPO_NAME
3329
from build_swift.build_swift.constants import SWIFT_SOURCE_ROOT
3430

35-
import six
36-
3731
from swift_build_support.swift_build_support import build_script_invocation
3832
from swift_build_support.swift_build_support import shell
3933
from swift_build_support.swift_build_support import targets
@@ -119,7 +113,7 @@ class JSONDumper(json.JSONEncoder):
119113
def default(self, o):
120114
if hasattr(o, '__dict__'):
121115
return vars(o)
122-
return six.text_type(o)
116+
return str(o)
123117

124118

125119
def print_xcodebuild_versions(file=sys.stdout):
@@ -506,7 +500,7 @@ def main_preset():
506500
try:
507501
preset_parser.read_files(args.preset_file_names)
508502
except presets.PresetError as e:
509-
fatal_error(six.text_type(e))
503+
fatal_error(str(e))
510504

511505
if args.show_presets:
512506
for name in sorted(preset_parser.preset_names,
@@ -527,7 +521,7 @@ def main_preset():
527521
args.preset,
528522
vars=args.preset_substitutions)
529523
except presets.PresetError as e:
530-
fatal_error(six.text_type(e))
524+
fatal_error(str(e))
531525

532526
preset_args = migration.migrate_swift_sdks(preset.args)
533527

utils/swift_build_support/swift_build_support/productpipeline_list_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def infer(self):
141141

142142
# Filter out any of the pipelines that before inference were not
143143
# selected.
144-
enabled_pipeline = filter(lambda x: x is not None, pipeline)
144+
enabled_pipeline = [p for p in pipeline if p is not None]
145145

146146
if self.args.verbose_build:
147147
print("-- Build Graph Inference --")

0 commit comments

Comments
 (0)